home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / shwtxt16.zip / SHOWTEXT.DOC < prev    next >
Text File  |  1995-03-21  |  113KB  |  2,082 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.               ┌────────────────────────────────────────────┐
  18.               │                                            │
  19.               │    S    H    O    W    T    E    X    T    │
  20.               │                                            │
  21.               └────────────────────────────────────────────┘
  22.                                VERSION 1.6
  23.  
  24.                      PROGRAMMING  LANGUAGE  MANUAL
  25.  
  26.  
  27.                (c) Garry Spencer / Spencer Technologies
  28.                P. O. Box 34OO9 - Memphis, TN - 38184-OOO9
  29.  
  30. The ShowText system consists of a number of files, which are listed in the
  31. text file PACKING.LST.
  32.  
  33. The function of these files is determined by their extension.
  34.  
  35. .ST   These files are ASCII text files which are edited by YOUR OWN
  36.       text-editor/word-processor and contain the command program that
  37.       will control program execution.  The syntax of each command in the
  38.       ShowText programming language is explained later in this document.
  39.       Your text-editor/word-processor MUST be capable of storing text
  40.       in plain ASCII format.
  41.  
  42. .STF  These files are the (Show Text File) drawing files which may be displayed
  43.       on the screen during program execution.  A single .ST file can hold up to
  44.       2048 (.STF) drawing files.
  45.  
  46. .EXE  These files are the finished executable files.  They are
  47.       generated by compiling the .ST file with any .STF file(s) which
  48.       the .ST file references.  All of this information is stored in the
  49.       .EXE file.  These files may be "run" by using the R command from within
  50.       the ST program or by issuing the appropriate DOS command.
  51.       Please note that any changes to the .ST command file or to any of the
  52.       .STF files that it references will require that the program be 
  53.       recompiled using the C command from within ST or by issuing the
  54.       DOS command (STC filename).
  55.  
  56.       Special Note about compiled .EXE files:
  57.       The .EXE files generated by the ShowText compiler (STC.EXE) have a
  58.       special overlay structure containing configuration data, library files
  59.       etc.  DO NOT attempt to compress these .EXE files with LZEXE, PKLITE,
  60.       DIET or any other .EXE file compressors.  You should also be sure that
  61.       you run the finished .EXE programs on systems having at least 512k bytes
  62.       free because provisions have been made to allow each of these programs
  63.       to store up to 63 text screens IN MEMORY!  It would probably not be
  64.       possible to run these programs from a SHELL-to-DOS.
  65.  
  66. The ShareWare files must be distributed together.  Under NO circumstances, are
  67. the REGISTERED version files to be distributed.
  68.  
  69. Attention Disk Vendors and BBS Sysops !
  70. To determine if this version of ShowText is the ShareWare or REGISTERED
  71. version, type STC at the DOS prompt.  The program (STC.EXE) will display a
  72. message which will show the version type.  If you distribute the ShareWare
  73. version in archived form (e.g. ZIPped), use the filename SHWTXT16.ZIP where
  74. (16) indicates version (1.6) .
  75.  
  76.  
  77.                          GENERAL INFORMATION
  78.  
  79.  
  80. The ShowText system is designed to allow you to build demonstration 
  81. programs, tutorial/help systems, games, batch file menus, product catalogs
  82. etc. using user-designed color text (ASCII) screens.  The finished .EXE files
  83. feature integrated mouse support.
  84.  
  85. Please note that the ShowText system is a programming language.  It is highly
  86. recommended that you have some programming experience (in any language) before
  87. attempting to use the ShowText language.
  88.  
  89. In the ShowText system, there are several stand-alone programs such as
  90. STD.EXE, STC.EXE.  These programs may be run from the DOS command
  91. line by specifying the appropriate file as an argument on the command line.
  92.  
  93. For example,
  94.  
  95. STD filename     will expect an .STF drawing file as the filename
  96. STC filename     will expect an .ST  command file as the filename
  97.  
  98. To simplify the operation of the system, there is a menu program (ST.EXE)
  99. which will allow you to control drawing, editing, compiling and running the
  100. program files.
  101.  
  102. To get started, type the command:
  103. ST filename      where filename is the project name (up to 8 characters).
  104.                  The project name is used for the .ST and .EXE files.
  105.  
  106. The next few pages will briefly describe the operation of the programs included 
  107. in the ShowText system (i.e. ST.EXE, STD.EXE, STC.EXE ).
  108.  
  109.        RUNNING THE MENU PROGRAM (ST.EXE)
  110.  
  111. When the ST program is executed for the first time on your system it will
  112. look for its configuration file named ST.CFG.  This file stores the
  113. command string which is used to invoke YOUR word-processor/text-editor.  If this
  114. file is not found, it will prompt you to enter the command string.  This is only
  115. done once.  If the ShowText files are not in the current directory, then the
  116. directory which contains them must be in the system PATH variable.
  117.  
  118. If the command line used to invoke ST did not contain a filename (project
  119. name), then you will be prompted to enter the project name.  This name is used
  120. as a default for the (.ST) and (.EXE) filenames.  Note that ST, STC, STD
  121. and STM are reserved names and should not be used as project names.
  122.  
  123. The following options (keystrokes) are available in ST (ShowText):
  124.  
  125. A - toggles the automatic mode. When AUTO is ON, the EDIT/COMPILE/RUN sequence
  126.     is performed automatically (if there are no compile-time errors).
  127.  
  128. C - compiles the .ST command file and any .STF file(s) that it references
  129.     into a finished executable (.EXE) file.
  130.  
  131. D - invokes the drawing program which will enable you to draw the color ASCII
  132.     text screens (.STF files) for use in your application program.
  133.  
  134. E - invokes YOUR word-processor/text-editor by executing a temporary batch file.
  135.     There was no need to develop a dedicated text-editor for ShowText since most
  136.     users already have a favorite text-editor/word-processor.  Please note that
  137.     your word-processor/text-editor MUST be capable of storing files in plain
  138.     ASCII text format.
  139.  
  140. P - allows you to change the project name which is used to name the .ST 
  141.     command files and the .EXE executable files.  The names (ST, STC and
  142.     STD) are reserved filenames.
  143.  
  144. R - runs the .EXE executable application program. Note that pressing CTRL and
  145.     SHIFT at the same time, while your application is running, will allow you to
  146.     adjust the mouse sensitivity.
  147.  
  148. X (or Esc) will terminate the ST program.
  149.  
  150. Windows users will need to select the DOS prompt, then type ST filename
  151. (in the appropriate directory).
  152.  
  153.        RUNNING THE DRAWING PROGRAM (STD.EXE)
  154.  
  155. The drawing program can be invoked from the command line or by selecting the
  156. D option in the menu program.  The drawing program is capable of loading and
  157. storing screen text files in three formats indicated by the extension:
  158.  
  159. .STF - (default) format for the ShowText system
  160. .BSV - format which can be used with BSAVE/BLOAD in BASIC programs
  161. .SCN - stores direct screen image (4000 bytes).
  162.  
  163. While in the drawing mode, you can access the HELP screen by pressing the F1
  164. key.  Note that the drawing files must be in the current directory.
  165.  
  166. Special Note: If you are designing screens which will be used on monochrome
  167.               systems, you should check the appearance of your screen files
  168.               on a (typical) target system.
  169. ------------------------------------------------------------------------------
  170.  
  171.        RUNNING THE COMPILER PROGRAM (STC.EXE)
  172.  
  173. The compiler program can be invoked from the command line or by selecting the
  174. C option in the menu program.  The program will compile (combine) the specified
  175. .ST command file with any .STF file(s) that it references into a single .EXE
  176. executable file.  Note that the .ST file and all needed .STF files must reside
  177. in the current directory.  The compiler will display any compile-time errors
  178. on the screen.
  179.  
  180. ------------------------------------------------------------------------------
  181.  
  182.        RUNNING THE EXECUTABLE PROGRAM (.EXE) FILES
  183.  
  184. The executable .EXE files can be invoked from the command line or by selecting
  185. the R option in the menu program.  Note that the mouse sensitivity can be
  186. adjusted by pressing CTRL and SHIFT at the same time while your application
  187. program is running.
  188.  
  189.  
  190.        PROGRAMMING CONVENTIONS
  191. ------------------------------------------------------------------------------
  192.        There are many instructions in the ShowText programming language that
  193.        require row and column information. You should be careful about allowing
  194.        the row value to exceed 25 or the column value to exceed 80. At one time,
  195.        these bounds were checked and adjusted, but these values are now 
  196.        allowed to be as high as 255 in order to provide the programmer with
  197.        some interesting options, such as linking up to 10 internal buffers
  198.        together with row offsets (from the first buffer) up to 250.  The 
  199.        minimum values are usually still adjusted to 1 if zero is given.
  200. ------------------------------------------------------------------------------
  201.        Labels are used to allow the program to resume execution at a different
  202.        location within the program. A label begins with a semi-colon (:) and
  203.        must be defined only once.  Note that a label must not contain embedded
  204.        spaces and may only be 8 characters (or less) in length.  It must
  205.        contain ONLY letters and/or numbers.  For example,
  206.  
  207.                    GOTO TEST123
  208.                    ∙∙∙(other statements skipped)∙∙∙
  209.        :TEST123    PRINT "Done"
  210. ------------------------------------------------------------------------------
  211.        Multiple statements (and labels) are allowed on the same program line by
  212.        separating the statements with a backslash.  For example,
  213.  
  214.        :QUIT                is the same as          :QUIT\CLS 7,0\C@1,1\EXIT
  215.         CLS 7,0
  216.         C@1,1
  217.         EXIT 
  218. ------------------------------------------------------------------------------
  219.        A program line can be continued on the next physical line by ending the
  220.        line with an underscore (_). Any leading spaces on the continuation line
  221.        are trimmed.  If leading spaces are to be preserved on the continuation
  222.        line, then start that line with an underscore (_).  Note: If any 
  223.        physical line starts with an underscore, the underscore is removed.
  224.        ex:  print "this   is _
  225.             _  a   test"
  226.             'preserve embedded spaces by placing underscore at the beginning
  227.        ex:  bfill 0 to 1 (1,1,_
  228.             25,80) 32 31
  229. ------------------------------------------------------------------------------
  230.        [var] is a variable (V0 to V255) or an indexed variable (VV0 to VV255).
  231.        [val] can also be a variable, an indexed variable or a number (0 to 255).
  232.        A variable is similar to an array element. V0 to V255 is similar to
  233.        V(0) to V(255) in some other languages.  An indexed variable uses the
  234.        contents of another variable as an index. VV0 to VV255 is similar to
  235.        V(V(0)) to V(V(255)).  There are still only 256 variables in the 
  236.        system.  Indexing only allows more options for the programmer. 
  237.        Variables may only contain values of 0 to 255.  Variables may assume an
  238.        optional alias by using the (%) sign followed by the alias-name.
  239.        ex: %TEMP=%MISC+4   'See the ALIAS command for more information.
  240. ------------------------------------------------------------------------------
  241.        The single-quote mark (') begins a comment line. The comment continues
  242.        until it reaches either the end of the line or a backspace (\).
  243.        'This is a test
  244.        %Test=%Temp+%Misc
  245.        %A=3 'set %A to 3 \ %B=7 'set %B to 7
  246.  
  247.        PROGRAMMING CONVENTIONS (cont'd)
  248.  
  249.        SPECIAL NOTES ABOUT IF STATEMENTS !!!
  250. ------------------------------------------------------------------------------
  251.        The (IF) statements normally assume that a GOTO will be executed if the
  252.        specified conditions are met.  The keyword GOTO is not necessary.  The
  253.        keyword GOSUB may be specified in any (IF) statement in order to allow
  254.        the program to jump to a subroutine. This rule works for ANY (IF)
  255.        statements.  For example,
  256.        IF CLK(10,25,15,60) TEST         would GOTO TEST  if condition is true 
  257.        IF CLK(10,25,15,60) GOSUB TEST   would GOSUB TEST if condition is true
  258. ------------------------------------------------------------------------------
  259.        ShowText now supports the standard IF-statement formats, such as:
  260.  
  261.        1. single-line IF
  262.           IF condition THEN true_action
  263.  
  264.        2. single-line IF
  265.           IF condition THEN true_action ELSE false_action
  266.  
  267.        3. block IF
  268.           IF condition_1 THEN
  269.              true_action_1
  270.           ELSEIF condition_2
  271.              false_action_1 and true_action_2
  272.           ELSE
  273.              false_action_1 and false_action_2
  274.           ENDIF
  275.  
  276.        SHOWTEXT PROGRAMMING LANGUAGE
  277. ------------------------------------------------------------------------------
  278.        ALIAS %aliasname=var,%aliasname=var ...etc
  279.  
  280.        Variables may assume an optional alias by using the (%) sign followed 
  281.        by the alias-name (using ONLY letters and/or numbers). Each alias can
  282.        be assigned only once. If a previously unassigned alias is encountered
  283.        in the program, it will be automatically assigned to the highest
  284.        subscript variable that does not already have an alias. Please note that
  285.        there are only 256 variables in the system and the variables can still
  286.        be accessed directly by using the Vxxx form. The compiler simply
  287.        performs a search-and-replace operation on the (%) terms.
  288.        ALIAS %ABC=V1,%XYZ=V5,%TMP=V12  (assigns alias %ABC to variable V1,
  289.                                         %XYZ to V5 and %TMP to V12)
  290.        ALIAS %TEMP=V4,%MISC=V8
  291.        %TEMP=7 \ %MISC = %TEMP + V3     is the same as     V4=7 \ V8=V4+V3
  292.  
  293.        Note: All alias names are converted to UPPERCASE by the compiler.
  294.              See the GUESS.ST and MMIND.ST programs for examples of alias use.
  295. ------------------------------------------------------------------------------
  296.        ARROWS
  297.        ARROWS OFF
  298.  
  299.        These two commands control how the arrow keys (up,down,left and right)
  300.        are interpreted by the system.  The first form (ARROWS) will cause the
  301.        program to move the screen cursor in response to the arrow keys. This
  302.        is the default mode.  The second form will cause the program to return
  303.        a keycode (up=200, down=208, left=203 and right=205) without moving the
  304.        screen cursor.  The mouse, if present, will continue to be able to move
  305.        the cursor.
  306. ------------------------------------------------------------------------------
  307.        ATTR val
  308.  
  309.        This instruction changes the current screen color (for printing) to val,
  310.        where val is the decimal equivalent of the binary attribute code
  311.        in the form:
  312.  
  313.        bbbbbbbb
  314.        │└─┤└──┴─── foreground color 0 to 15
  315.        │  └─────── background color 0 to 7
  316.        └────────── blink bit (foreground will blink if set)
  317.  
  318.        (see the table for the COLOR statement to determine colors)
  319.        Variables or numbers may be used to specify (val).
  320.        This instruction is useful where the default colors have been stored in
  321.        a variable with ( var=[AT;] ).  The color can be restored very easily
  322.        with (ATTR var).
  323.        example:  ATTR 31 would set foreground to white and background to blue
  324.                  white=15  blue=1   color_byte= (1*16) + 15 = 31
  325. ------------------------------------------------------------------------------
  326.        BEEP
  327.  
  328.        This instruction causes the PC speaker to emit a short beep (tone).
  329.  
  330.        BCOPY source TO dest (row1,col1,row2,col2)
  331.        BCOPY source TO dest (row1,col1,row2,col2) OFFSET (row3,col3)
  332.  
  333.        This instruction (in both forms) copies a block of text from the
  334.        source buffer (0 to 63) to the destination buffer (0 to 63).  The
  335.        block is defined by the row1,col1 (upper-left corner) and the row2,col2
  336.        (lower-right corner).  The first form of the instruction copies the
  337.        text to the same part of the buffer.  The second form of the instruction
  338.        copies the text to the upper-left corner defined by row3,col3 providing
  339.        a way to offset the text in the destination buffer.  Variables and/or
  340.        numbers may be used for the row/column information. The word OFFSET is
  341.        optional.
  342.        Note: buffer 0 is the screen - buffers 1 to 63 are internal buffers
  343.        example: BCOPY 1 TO 0 (1,1,25,80) 'copy entire buffer 1 to screen
  344. ----------------------------------------------------------------------------
  345.        BFILL buffer (row1,col1,row2,col2) ASCII val
  346.        BFILL buffer (row1,col1,row2,col2) ATTR val
  347.        BFILL buffer (row1,col1,row2,col2) val val
  348.  
  349.        This instruction (in all three forms) will fill an area in the buffer
  350.        with an ASCII character and/or an attribute (foreground/background 
  351.        color).  The boundaries of the block are defined by row1,col1 (as the
  352.        upper-left corner) and row2,col2 (as the lower-right corner). The first
  353.        form, with the keyword ASCII, will only fill the block with the ASCII
  354.        character code specified in val.  The second form, with the ATTR keyword,
  355.        will only fill the block with the foreground/background color specified
  356.        as an attribute in val.  The third form, with two values, will fill the
  357.        block with the ASCII character code specified in the first val and the
  358.        foreground/background color specified as an attribute in the second val.
  359.        See the ATTR command for a description of an attribute byte.
  360.        e.g. BFILL 0 (11,42,15,61) 32 7
  361.             fills the area on the screen with black spaces.
  362.        Note: buf=0 for screen or buf=1 through 63 for internal buffers
  363. -------------------------------------------------------------------------------
  364.        BSWAP buffer TO buffer (row1,col1,row2,col2)
  365.        BSWAP buffer TO buffer (row1,col1,row2,col2) OFFSET (row3,col3)
  366.  
  367.        This instruction is nearly identical to the BCOPY command, except
  368.        that the two blocks are swapped.  see: BCOPY
  369.        example: BSWAP 0 TO 1 (1,1,25,80) 'swap entire screen with buffer 1
  370. -------------------------------------------------------------------------------
  371.        BXOR buffer (row1,col1,row2,col2) xorvalue
  372.  
  373.        The BLOCK-EXCLUSIVE-OR instruction causes the color attributes in the
  374.        specified "block" (or "box") in the selected buffer to be XORed with the
  375.        xorvalue.  This can be used to make the block flash etc.  If a region is
  376.        XORed twice with the same xorvalue, then the color attributes of that
  377.        region will be returned to their original values.
  378.        example:  BXOR 0 (1,1,25,80) 127 \ WAIT .09 'flash the entire screen
  379.                  BXOR 0 (1,1,25,80) 127 \ WAIT .09 'then return to normal
  380.        Note: upper-left-corner is row1,col1 and lower-right-corner is row2,col2
  381. -------------------------------------------------------------------------------
  382.        C@ row,column
  383.  
  384.        This instruction locates the screen cursor at the specified row 
  385.        (1 to 25) and column (1 to 80).  For example, C@12,40 would locate
  386.        the screen cursor at row 12 and column 40.
  387.  
  388. -------------------------------------------------------------------------------
  389.        CHK    and    NOCHK
  390.  
  391.        These instructions turn the keyboard/mouse monitoring routines ON/OFF.
  392.        The program normally checks the keyboard/mouse status between each
  393.        statement.  This allows quick response to user input especially the
  394.        interrupt keys specified in the ON INTKEYn statements, but can also
  395.        slow the program down during intensive tasks such as repetitive PEEK
  396.        and POKE operations.  The NOCHK command causes the program to ignore
  397.        the keyboard and mouse except when a WAIT or WAITKEY command is
  398.        executed.  This statement should be used carefully because it can cause
  399.        the cursor to 'freeze' at a point on the screen between WAIT and/or
  400.        WAITKEY statements.  The CHK command should be executed as soon as
  401.        possible.  It may occasionally be necessary for the RST K
  402.        command to be executed prior to executing the CHK statement, because
  403.        it will clear the PC keyboard buffer of any input encountered while the
  404.        NOCHK was in effect.
  405. ----------------------------------------------------------------------------
  406.        CLS   or   CLS foreground,background
  407.  
  408.        This instruction (in both forms) clears the screen.  The first form
  409.        clears the screen in the current foreground/background colors.  The
  410.        second form is equivalent to COLOR foreground,background\CLS. Note that
  411.        the print cursor is set to row=1 and column=1.  See the table of colors
  412.        for the COLOR command.
  413.        ex: CLS 15,1 'clear screen white foreground (15) & blue background (1)
  414. ----------------------------------------------------------------------------
  415.        COLOR foreground
  416.        COLOR foreground,background
  417.  
  418.        This instruction (in both forms) changes the default screen color
  419.        (for printing).  The first form only changes the foreground while the
  420.        second form changes both the foreground and background colors.  The
  421.        available colors are shown in the following table:
  422.  
  423.           Foreground                        Background
  424.        ------------------                   --------------------
  425.        0  black                             0   black
  426.        1  blue                              1   blue
  427.        2  green                             2   green
  428.        3  cyan (blue-green)                 3   cyan (blue-green)
  429.        4  red                               4   red
  430.        5  magenta (purple)                  5   magenta (purple)
  431.        6  brown                             6   brown
  432.        7  light gray                        7   dark gray
  433.        8  dark gray
  434.        9  bright blue
  435.       10  bright green
  436.       11  bright cyan (blue-green)
  437.       12  bright red
  438.       13  bright magenta (purple)
  439.       14  bright yellow
  440.       15  bright white
  441.  
  442.       Note: The text can be made to blink by adding 16 to the foreground color.
  443.             Variables or numbers may be used to specify the colors.
  444.       example: COLOR 4,3 'change colors to red foreground=4, cyan background=3
  445.  
  446.        COPY (source,destination)
  447.        COPY (source,destination) optionalfade
  448.        COPY ( $(buffer,row,column1,column2) , destinationbuffer) optionalfade
  449.  
  450.        This instruction is the heart of the ShowText system.  In all forms,
  451.        it allows an entire screen image to be copied from the source to the
  452.        destination.
  453.  
  454.        The source and destination may be:
  455.              0        which is the screen (or virtual screen)
  456.              1 to 63  which are internal buffers
  457.              variables V0 TO V255
  458.              indexed variables VV0 to VV255.
  459.  
  460.        The source may also be a library file specified by up to 8 characters.
  461.        The default (only) extension is .STF.  These files must be present in
  462.        the current directory at compile time (using STC.EXE).  These files are
  463.        stored in the resultant .EXE executable file.  This means that the
  464.        individual (.STF) files do not need to be distributed to the end user of
  465.        the (.EXE) executable file.  The file names must NOT be in the same form
  466.        as a variable, number or math operation (e.g. 123,V123,VV123,TEST-123,
  467.        ABC&DEF etc.) since the compiler would assume that you meant to use an
  468.        actual variable, number or math operation as the source buffer number.
  469.        The reserved math operator symbols + - * / ~ ^ < = > ` & @ # | MUST NOT
  470.        be used as part of a filename in the COPY(filename,bfr) instruction.
  471.  
  472.        For example, COPY (TEST,7) would copy the file TEST.STF (which had 
  473.        been stored in library format inside the .EXE file) to internal buffer 7.
  474.  
  475.        The second form of this instruction may be used whenever the destination 
  476.        is buffer 0 (which is the screen).  The "fade" value can be a number or a
  477.        variable and tells the program how to draw the image on the screen.  The
  478.        ShowText system supports a fairly large number of fades.  If a fade is
  479.        specified that is greater than the number of available fades, the default
  480.        fade of 0 (quick) is used.  If the fade number 255 is used, the program
  481.        will pick a fade at random.
  482.  
  483.        For example, V1=4 \ COPY (V1,0) 1
  484.                     '---or---
  485.                     COPY (4,0) 1
  486.        would copy the screen image in buffer 4 to the screen using the fizz
  487.        fade.  Please refer to the table of available fades in the appendix of
  488.        this documentation file.
  489.  
  490.        The third form of this instruction is used to search the internal library
  491.        directory for the filename (8 characters) which is specified by the
  492.        buffer text string.  The EXTRA variable is set to 255 if the search is
  493.        successful and is reset to zero if this command fails to find the
  494.        filename in the internal library directory.  Please refer to the $LIB ADD
  495.        compiler directive for information about making sure that certain files
  496.        are placed in the internal library.  Note: The filename, that is used
  497.        with the third form, MUST be in uppercase format (ex: FILENAME).  The
  498.        internal directory is maintained in UPPERcase format.
  499.  
  500.        ex: COPY ( $(63,1,12,19) , 2 ) 55    would search the internal library
  501.        directory for the filename specified in the buffer text string located
  502.        in buffer 63 on row 1 between columns 12 and 19. If the filename is
  503.        found, it would be copied to buffer 2 using fade 55.
  504.  
  505.        CSR LIM (toprow , leftmostcolumn , bottomrow , rightmostcolumn)
  506.        CSR LIM
  507.  
  508.        The first form, with operands, sets the limits on the screen cursor
  509.        location and the second form, with no operands, restores the limits 
  510.        to include the entire screen.
  511.        ex: WINDOW (15,35,25,65) 100 \ CSR LIM (15,35,25,65)
  512.            'this would force the cursor to stay inside the window
  513.            'upper-left (row=15,column=35) and lower-right (row=25,column=65)
  514. ----------------------------------------------------------------------------
  515.        CSR ON num TO num            (where num is the scan line 0 to 7)
  516.        CSR                          (default is CSR ON)
  517.        CSR OFF
  518.  
  519.        The first form (CSR ON num TO num ) will cause the cursor to be
  520.        visible.  The two numbers determine the size of the cursor.  Scan
  521.        line 0 is the top, while scan line 7 is the bottom line (of the cursor)
  522.        on a VGA monitor.  The form (CSR OFF) causes the cursor to be
  523.        invisible.  Variables can NOT be used to specify the scan lines.
  524.        Note: When a program (.EXE) is run, the cursor will initially be off.
  525.        For example:
  526.        CSR ON 0 TO 7 makes a large cursor appear on the screen
  527.        CSR OFF turns the cursor off
  528.        CSR with no arguments turns cursor on using last scan numbers 0 & 7
  529.  
  530. ShowText Language - Special Directory Commands
  531.  
  532.       DIRTOP
  533.       DIRBOT
  534.       DIRPRV
  535.       DIRNXT
  536.       DIRCMP  or  DIRCMP "filename"  or  DIRCMP $(bfr,row,startcolumn,endcolumn)
  537.       DIRCPY buffer,fade
  538.       DIRFND "filename" or DIRFND $(bfr,row,startcolumn,endcolumn)
  539.       DIRPRT buffer,row,column,attribute
  540.  
  541. If the compiled program, in .EXE form, contains any imbedded screen text files,
  542. then an internal directory of these 8-character filenames is maintained by the
  543. program (in alpha sort order).  These commands (above) allow limited access to
  544. this area.
  545.  
  546. A directory pointer is also maintained, although its exact value is not
  547. available, since up to 2048 screen files can be stored; but all variables have
  548. a maximum value of 255.  The [DIR] system variable returns information ABOUT the
  549. internal directory pointer but not its actual value.  These return values are:
  550.  0=no files in directory
  551.  1=now pointing to first directory entry (i.e. after DIRTOP cmd)
  552.  2=now pointing to last  directory entry (i.e. after DIRBOT cmd)
  553.  3=pointing to first and last directory entry (i.e. only 1 file in library)
  554.  4=now pointing to somewhere between first and last entries
  555.  
  556. The DIRTOP instruction places the directory pointer at the top (first) entry.
  557.  
  558. The DIRBOT instruction places the directory pointer at the bottom (last) entry.
  559.  
  560. The DIRPRV instruction places the directory pointer at the previous entry,
  561. unless the directory pointer was already pointing at the top (first) entry.
  562.  
  563. The DIRNXT instruction places the directory pointer at the next entry,
  564. unless the directory pointer was already pointing at the bottom (last) entry.
  565.  
  566. Note: The [DIR] system variable is updated each time any of these four 
  567.       instructions are executed.
  568.  
  569. The DIRCMP instruction CoMPares the specified text "filename" with the current
  570. directory entry (stored internally in memory).  If these match, the EXTRA system
  571. variable [X] is set to 255, otherwise it is reset to zero. The question-mark (?)
  572. can be used as a wildcard in the "filename" text string.  This text string must
  573. be from 1 to 8 characters in length, and only the number of characters in the
  574. text string will be compared.  
  575. Note that the buffer text string $(bfr,row,startcol,endcol) can be used as the
  576. comparison text, although the filename MUST be in UPPERcase form (e.g.FILENAME)
  577. ex#1: DIRCMP "ABC"       if the first 3 characters of the internal directory
  578.                          entry are ABC, then [X]=255 otherwise [X]=0.
  579. ex#2: DIRCMP "ABC??XYZ"  if the first 3 characters of the internal directory
  580.                          entry are ABC and the last 3 characters are XYZ, then
  581.                          the EXTRA system variable [X]=255 otherwise [X]=0.
  582. ex#3: DIRCMP $(0,12,1,8) compares the text (that resides in buffer 0, on row 12,
  583.                          between columns 1 and 8) with the internal directory
  584.                          entry. If it matches, [X]=255 otherwise [X]=0.
  585. Note: If DIRCMP is used without an operand, it uses the LAST text specified.
  586.  
  587. ShowText Language - Special Directory Commands - (continued)
  588.  
  589. The DIRCPY instruction is used to CoPY the file, currently being pointed to
  590. by the directory-entry-pointer, into the specified buffer, using the specified
  591. fade value.  Note: the fade value must be specified. If no fade is desired, 
  592. simply use a fade value of zero.
  593. Ex: DIRTOP
  594.     DIRCPY 0,2
  595.     'would copy the first file (in the internal library directory)
  596.     'into buffer 0 (the screen) using the melt-down fade (#2).            
  597.  
  598. The DIRFND attempts to FiND the specified filename in the internal library
  599. directory.  If it is successful, the EXTRA system variable [X] is set to 255,
  600. otherwise it is reset to zero.  The directory-entry-pointer is positioned
  601. at the specified entry (if found), otherwise it is placed at the position
  602. that would have been occupied by the specified entry.  Note that NO wildcards
  603. are permitted with this instruction and that the specified filename must be
  604. 8 characters in length, otherwise it will be right-padded with spaces. 
  605.                                                       
  606. The DIRPRT instruction PRinTs the 8-character internal directory-entry filename
  607. using the specified buffer, row, column and attribute information.
  608. ex: DIRPRT 0,25,21,31 prints the 8-character internal directory-entry filename
  609.                       to buffer 0, on row 25, starting at column 21, using an
  610.                       attribute value of 31 (bright white on blue).
  611.  
  612. form1: DO {WHILE|UNTIL|UNLESS} condition
  613.        ∙∙∙                              
  614.        ∙∙∙statements∙∙∙
  615.        ∙∙∙                              
  616.        LOOP                             
  617.  
  618. form2: DO
  619.        ∙∙∙
  620.        ∙∙∙statements∙∙∙
  621.        ∙∙∙
  622.        LOOP {WHILE|UNTIL|UNLESS} condition
  623.  
  624.        The first form of the DO-LOOP tests the condition for looping at the
  625.        beginning of the loop.  The second form performs the test at the end of 
  626.        the loop.  One of the keywords WHILE/UNTIL/UNLESS is necessary to specify
  627.        which type of test to perform.  Looping will continue as long as the
  628.        conditions are met.  For example, the following two loops would print
  629.        the numbers 1 through 10.
  630.  
  631.          %I=0                            %I=1
  632.          DO                              DO WHILE %I<=10
  633.          %I++                            PRINT %I,3Q
  634.          PRINT %I,3Q                     %I++
  635.          LOOP UNTIL %I=10                LOOP
  636.  
  637.        Special Note: The GOLOOP instruction can be used to perform a GOTO to
  638.        the next LOOP instruction as if a label was assigned to it.  The
  639.        EXITDO/XDO instructions can be used to perform a GOTO to the instruction
  640.        immediately following the next LOOP instruction.  These instructions will
  641.        properly handle nested DO/LOOPs, so that a GOLOOP (or EXITDO or XDO) in
  642.        an outer loop will seek the appropriate LOOP instruction.
  643. -------------------------------------------------------------------------------
  644.        ERRORLEVEL val
  645.  
  646.        This instruction sets the DOS ERRORLEVEL variable to (val).  The last
  647.        ERRORLEVEL statement executed before the program exits will determine
  648.        the value which is returned to DOS.  This value can be tested by DOS
  649.        in a batch file to allow branching or conditional execution of a
  650.        particular batch command.  This makes it possible to use ShowText in
  651.        a batch file menuing system.  The argument (val) can be a number or a
  652.        variable.  Its initial value is zero.
  653.        example: ERRORLEVEL 7 would set the DOS error level to 7
  654. ----------------------------------------------------------------------------
  655.        EXIT    {or X}
  656.        EXITC   {or XC}
  657.  
  658.        The EXIT instruction allows the program to return to DOS (or to the
  659.        ShowText menu).  If the .EXE program is invoked from DOS, then it
  660.        will exit to DOS.  Note that the screen is not cleared, and the DOS
  661.        cursor is set to the last row value of the print cursor.  If you wish
  662.        to end a program with the screen cleared and with the DOS cursor at
  663.        row 1, then use the command EXITC.
  664.  
  665.        FOR loop_var = loop1 to loop2 STEP  loop3     {pos.steps  loop1<=loop2 )
  666.        FOR loop_var = loop1 to loop2 NSTEP loop3     {neg.steps  loop1>=loop2 }
  667.        NEXT loop_var
  668.  
  669.        (where the loop variable (loop_var) must be a variable V0 to V255,
  670.         or an ALIASed variable (e.g. %i) and must NOT be an indexed variable.)
  671.        (loop1,loop2 and loop3 can be numbers, variables or indexed variables)
  672.  
  673.        These instructions allow the program to loop through a section of
  674.        program code - between the FOR and the NEXT statements.
  675.        loop1 = starting value of the loop variable (loop_var).
  676.        loop2 = ending value for the loop variable
  677.        loop3 = incremental step between iterations (always greater than zero)
  678.                (default is 1 if the word STEP and loop3 are not specified)
  679.        For example:   FOR V1=3 TO 9 STEP 2 \ PRINT V1,1 \ NEXT V1
  680.        would cause the variable V1 to be printed with values of 3,5,7 and 9.
  681.        Note: Do NOT jump from the outside of a FOR/NEXT loop into the inside!
  682.  
  683.        The FOR/NEXT loops can be nested, but be careful to nest these
  684.        loops properly.
  685.        e.g.   right:  FOR V1=1 TO 4 \ FOR V2=3 TO 9 \ NEXT V2 \ NEXT V1
  686.               wrong:  FOR V1=1 TO 4 \ FOR V2=3 TO 9 \ NEXT V1 \ NEXT V2
  687.        If NEXT is specified without a variable, the last open FOR loop
  688.        variable is used.  For example,
  689.        FOR V1=1 TO 10 \ FOR V2=3 TO 5 \ NEXT \ NEXT
  690.        The first NEXT closes the FOR V2 loop and the second NEXT closes the
  691.        FOR V1 loop.
  692.  
  693.        Special Note: The GONEXT instruction can be used to perform a GOTO to
  694.        the next NEXT instruction as if a label was assigned to it.  The EXITFOR
  695.        instruction can be used to perform a GOTO to the instruction immediately
  696.        following the next NEXT instruction.  These instructions will properly
  697.        handle nested FOR/NEXT loops, so that a GONEXT (or EXITFOR) in an outer
  698.        loop will seek the appropriate NEXT instruction.
  699. ------------------------------------------------------------------------------
  700.        GOTO label         {or GT label}
  701.  
  702.        This instruction transfers control to the specified label.  Program
  703.        execution will continue at that point in the program code.  The label
  704.        can be preceded by a (:) in the GOTO statement.
  705.        For example   GOTO :TEST    and    GOTO TEST  are identical in operation.
  706. ------------------------------------------------------------------------------
  707.        GOSUB label        {or GS label}
  708.        RETURN or RET
  709.  
  710.        The GOSUB statement pushes the address immediately following the GOSUB
  711.        onto the stack.  The program will then transfer control to the specified
  712.        label (like a GOTO).  The subroutine will continue execution until a
  713.        RETURN is encountered.  The RETURN will pop an address off the stack and
  714.        will transfer control to that address.  If the stack is empty (as in the
  715.        case when a RETURN without GOSUB situation occurs) the RETURN statement
  716.        would not signal an error but would simply do nothing.
  717.        example: :HERE  \ GOSUB TEMP
  718.                 :THERE \ ...other statements...
  719.                 :TEMP  \ PRINT "subroutine called" \ RET
  720.        When the label (HERE) is reached, control goes to (TEMP).  The RET
  721.        causes program execution to continue at label (THERE).
  722.  
  723.        IF BSAME buf TO buf (row1,col1,row2,col2) (row3,col3) label
  724.        IF BDIFF buf TO buf (row1,col1,row2,col2) (row3,col3) label
  725.  
  726.        The first instruction compares the contents of two buffers and performs
  727.        a GOTO label if the blocks are the same.  If the specified blocks are
  728.        not the same, program execution continues at the statement following the
  729.        IF BSAME instruction.  The comparison is performed on ASCII text only
  730.        (i.e. the attribute is not checked).  The coordinates row1,col1,row2,col2
  731.        correspond to the upper-left and lower-right corners (respectively) of
  732.        the block in the first buffer.  The coordinates row3,col3 correspond to
  733.        upper-left corner of the block in the second buffer.  Note that if the
  734.        (row3,col3) term is omitted then the same coordinates are used in BOTH
  735.        blocks/buffers.  If a coordinate is specified outside the range (row=1
  736.        to 25 and col=1 to 80) the block is downsized accordingly.  Normally,
  737.        this should not be a problem.  Buffer 0=screen and buffer 1 through 63
  738.        are internal buffers.
  739.        example: IF BSAME 0 TO 1 (1,1,25,80) (1,1) ALIKE
  740.               'if entire screen is identical to buffer 1 then go to label ALIKE 
  741.               'else continue at statement following this IF BSAME instruction
  742.        Note: The IF BDIFF instruction will GOTO label if the blocks are 
  743.              different.
  744.  
  745.  
  746.        IF CLK (row1,col1,row2,col2) label
  747.        IF NOT CLK (row1,col1,row2,col2) label
  748.  
  749.        When the user presses a key (or a mouse button), the ShowText system
  750.        generates three things: a KEY (0 to 255) value , a ROW CLICK
  751.        (row 1 to 25) value and a COLUMN CLICK (column 1 to 80) value.  These
  752.        values are placed in a 63 byte circular (first-in-first-out) buffer.
  753.        The O-N-L-Y way to make these values available to the program is to
  754.        execute a WAITKEY command.  The WAITKEY command retrieves the next
  755.        character in the keyclick buffer.  If no user input is waiting then
  756.        KEY=0 (NULL),ROW CLICK=0 and COLUMN CLICK=0.
  757.  
  758.        The IF CLK and IF NOT CLK commands simply test the last (row,column)
  759.        click values which were made available by the WAITKEY command.
  760.        A block on the screen defined by the upper-left (row1,col1) and the 
  761.        lower-right (row2,col2) coordinates is tested to see if the last click
  762.        was within its range.  The first form (IF CLK) will execute a GOTO
  763.        label if it was within its defined block.  The second form (IF NOT CLK)
  764.        will execute a GOTO label if it was not within its defined block.
  765.  
  766.        If either of the IF statements fail, the program continues execution
  767.        at the statement immediately following the IF statement.  This is the
  768.        way all of the IF statements work.
  769.  
  770.        example: IF CLK (25,1,25,80) TEMP
  771.        If the mouse/keyboard is pressed while the cursor is on the bottom
  772.        row (25), then program execution will continue at label TEMP.
  773. ----------------------------------------------------------------------------
  774.  
  775.        IF CSR (row1,col1,row2,col2) label
  776.        IF NOT CSR (row1,col1,row2,col2) label
  777.  
  778.        where row1,col1 define the upper-left corner of the test block while
  779.        row2,col2 define the lower-right corner.
  780.  
  781.        These instructions check the location of the screen cursor to determine
  782.        if it is within the defined block.  The IF CSR instruction will
  783.        execute a GOTO label if the screen cursor is within its defined block.
  784.        The IF NOT CSR will execute a GOTO label if the screen cursor is not
  785.        within its defined block.
  786.  
  787.        example: IF CSR (25,1,25,80) TEMP
  788.        If the mouse/keyboard moves the screen cursor to the bottom
  789.        row (25), then program execution will continue at label TEMP.
  790.  
  791.        IF KEY key label
  792.        IF NOT KEY key label
  793.  
  794.        When the user presses a key (or a mouse button), the ShowText system
  795.        generates three things: a KEY (0 to 255) value , a ROW CLICK
  796.        (row 1 to 25) value and an COLUMN CLICK (column 1 to 80) value. These
  797.        values are placed in a 63 byte circular (first-in-first-out) buffer.
  798.        The O-N-L-Y way to make these values available to the program is to
  799.        execute a WAITKEY command.  The WAITKEY command retrieves the next
  800.        character in the keyclick buffer.  If no user input is waiting then
  801.        KEY=0 (NULL), ROW CLICK=0 and COLUMN CLICK=0.
  802.  
  803.        The IF KEY and IF NOT KEY commands will test the KEY value for a match.
  804.        The first form (IF KEY) will execute a GOTO label if the KEY value
  805.        matches its test value.  The second form (IF NOT KEY) will execute a
  806.        GOTO label if the KEY value does not match its test value. Note that
  807.        the arrow-keys (up,down,left,right) can NOT be trapped.
  808.  
  809.        e.g.  IF KEY ESC TEST would GOTO TEST if the last key was an escape.
  810.              IF NOT KEY NULL TEST would GOTO TEST if any key was pressed.
  811.  
  812.        other valid examples include:
  813.  
  814.        IF KEY ALT F1 TEST       (note that ALT CTRL SHIFT can be used but
  815.        IF KEY CTRL F1 TEST       not in the same statement)
  816.        IF KEY SHIFT F1 TEST
  817.        IF KEY SPACE TEST
  818.        IF KEY A TEST   (note: keyboard input is tested as capitalized (a=A) )
  819.        IF KEY 7 TEST
  820.        IF KEY $ TEST
  821. ----------------------------------------------------------------------------
  822.        IF Tn >= seconds label
  823.        IF Tn < seconds label
  824.  
  825.        where n=0 to 15
  826.        where seconds is a number between 0 and 3600 seconds
  827.        (note: a math expression for timer number is NOT allowed here)
  828.        (note: The >= and < comparison operators are the ONLY ones allowed)
  829.  
  830.        These instructions check the specifed 16 bit timer to determine how
  831.        much time (in seconds) has elapsed since the last RST Tn was
  832.        executed.  The [ IF Tn >= ] will execute a GOTO label if the timer
  833.        value equals or exceeds the seconds value.  The [ IF Tn < ] will
  834.        execute a GOTO label if the timer value is less than the seconds value.
  835.        If the timer itself is allowed to exceed 3600.8 (which is a little more
  836.        than 1 hour ), the timer value is maintained at 3600.8 seconds (which
  837.        is internally expressed as 65535/18.2).  The resolution is about
  838.        1/18.2 of a second.  There are sixteen of these 16-bit timers available.
  839.        example:          RST T2           \ ' resets timer#2 to 0
  840.                  :LOOP \ IF T2 < 4.5 LOOP \ ' stays in loop for 4.5 seconds
  841.  
  842.        IF var <  val label
  843.        IF var <= val label
  844.        IF var <> val label
  845.        IF var =  val label
  846.        IF var >  val label
  847.        IF var >= val label
  848.  
  849.        These instructions test the variable (var) with the specified value 
  850.       (val).  A GOTO label is executed if the condition is true.
  851.  
  852.        example:  IF V1 <= V2 TEMP
  853.                  would go to label TEMP if V1 is less than or equal to V2
  854.  
  855.                  IF %ABC = %XYZ+2 TEST
  856.                  would go to label TEST if variable %ABC is equal to (%XYZ + 2)
  857. --------------------------------------------------------------------------------
  858.        IF var label      'GOTO label if var is non-zero
  859.        IF NOT var label  'GOTO label if var is zero
  860. --------------------------------------------------------------------------------
  861.       *See the special note about IF statements in the PROGRAMMING CONVENTIONS
  862.        section near the beginning of this document.
  863.  
  864.        INPUT TEXT (row, startingcolumn, endingcolumn, attribute)
  865.        INPUT TEXT CAPS (row, startingcolumn, endingcolumn, attribute)
  866.        INPUT var  (row, startingcolumn, endingcolumn, attribute)
  867.  
  868.        The INPUT TEXT instruction allows the user to type a string of text
  869.        on the screen.  An edit-window is opened on the screen on the specified
  870.        row and between startingcolumn and endingcolumn.  NO error checking is
  871.        done on the coordinates.  Do NOT allow the input field to wrap around
  872.        to the next screen row ! The color of the input text is determined by 
  873.        the attribute value (see ATTR command).
  874.        Note: The default screen cursor/colors are not changed by this command.
  875.        The text can be upper or lower case but if the CAPS keyword appears in
  876.        the command, the text will be capitalized when the input is finished.
  877.        This text is only placed on the screen, but BCOPY can be used to
  878.        move it to a buffer.  The left-arrow, right-arrow and backspace are the
  879.        editing keys.  The Enter and Escape keys will terminate the text input
  880.        routine.  It is possible to use var=[K] to find out which key
  881.        terminated the routine (Enter=13 or Escape=27).  The var=[.C]
  882.        command will return the column position of the rightmost non-space
  883.        character in the input text field.  All type-ahead is cancelled prior
  884.        to executing INPUT TEXT.
  885.        The INPUT var command is identical except that the text string is 
  886.        converted to a number which is then placed in the specified variable.
  887.        Note that non-numeric characters in the text field are actually ignored.
  888.        The number must be in the range 0 to 255 or else the specified variable
  889.        will contain 0 (zero) and the EXTRA [X] variable will contain 255.
  890.  
  891.        INPUT TEXT (1,10,20,31) would input white/blue text on
  892.                                row 1 between columns 10 and 20 (mixed-case)
  893.        INPUT TEXT CAPS (1,10,20,31) would input white/blue text on
  894.                                     row 1 between columns 10 and 20 and then
  895.                                     would capitalize it on-screen
  896.        INPUT V1 (1,10,20,31) would input a numeric value using white/blue text
  897.                              on row 1 between columns 10 and 20
  898.  
  899.        Note: The screensaver function will not operate during the INPUT TEXT 
  900.              function. You may substitute a question mark (?) for INPUT.
  901.                        ?TEXT (row, startingcolumn, endingcolumn, attribute)
  902.                        ?TEXT CAPS (row, startingcolumn, endingcolumn, attribute)
  903.                        ?var (row, startingcolumn, endingcolumn, attribute)
  904. --------------------------------------------------------------------------------
  905.        MEM PEEK offset var
  906.  
  907.        This instruction will look at the PC's lowest 64k memory segment
  908.        0000:offset and will place the value in the variable (var). This
  909.        is useful for checking keyboard shift status, video mode etc.
  910.        For example, MEM PEEK 1047 V1 would place the keyboard shift status
  911.        in variable V1 where the binary weight of each bit is as follows:
  912.           1 = right Shift pressed          16 = Scroll-Lock ON
  913.           2 = left Shift pressed           32 = Num-Lock ON
  914.           4 = Ctrl key pressed             64 = Caps-Lock ON
  915.           8 = Alt key pressed             128 = Insert mode ON
  916.  
  917.        LEFT MOUSE key
  918.        CENTER MOUSE key
  919.        RIGHT MOUSE key
  920.  
  921.        These instructions will specify which keycode is sent to the program
  922.        when a mouse button is pressed.  The default is SPACE (code=32).
  923.  
  924.        e.g.  LEFT MOUSE ENTER
  925.              RIGHT MOUSE ESC
  926.  
  927.        SPECIAL NOTE:
  928.        When running an application, which has been developed using the
  929.        ShowText system, the mouse sensitivity can be adjusted by pressing
  930.        Shift and Ctrl at the same time.  The default sensitivity is set for
  931.        a 200 dpi mouse.
  932. ----------------------------------------------------------------------------
  933.        ON INTKEYn key GOSUB label
  934.        ON INTKEYn key GOTO label
  935.  
  936.        where n can be 0 to 7 and key is a specified key code
  937.  
  938.        These instructions allow the programmer to specify up to 8 critical
  939.        keys that the program should watch for.  The specified action is taken
  940.        regardless of what the program was doing (like an interrupt).  An 
  941.        example might include a system-wide help screen or exit function.
  942.        NOTE: When an interrupt key is pressed, the current keyclick values
  943.        (KEY,ROW CLICK and COLUMN CLICK) are NOT overwritten by the interrupt
  944.        key's keyclick values.  You may use the IF CSR to access the current
  945.        screen-cursor values.
  946.  
  947.        e.g.  ON INTKEY0 CTRL C GOTO QUIT
  948.              ON INTKEY1 F1 GOSUB HELP
  949.              ∙
  950.              ∙ (other statements)
  951.              ∙
  952.             :HELP 
  953.              ∙
  954.              ∙ (other statements)
  955.              ∙
  956.              RETURN
  957.              ∙
  958.             :QUIT \ C@1,1 \ EXIT
  959.  
  960.         When using the GOSUB option, it is a good idea to save the screen
  961.         to a safe place like internal buffer 63 and then restore it prior
  962.         to executing a RETURN.  The current screen-cursor and print-cursor
  963.         values should also be saved (to variables) and restored if they are
  964.         changed inside the subroutine.  The command ON INTKEYn NULL will
  965.         effectively disable an interrupt key.  It can enabled again later.
  966.  
  967.        ON var GOTO label1,label2,label3,label4
  968.        ON var GOSUB label1,label2,label3,label4
  969.  
  970.        These instructions will take the appropriate action (GOTO or GOSUB)
  971.        based on the value of the variable (var).
  972.  
  973.        For example,
  974.        ON V1 GOTO FIRST,SECOND,THIRD
  975.        If the variable V1=1 then the program would GOTO FIRST
  976.        If the variable V1=2 then the program would GOTO SECOND
  977.        If the variable V1=3 then the program would GOTO THIRD etc.
  978.        If the variable is equal to zero or the variable is greater than
  979.        the number of labels, then program execution will resume at the
  980.        statement following the (ON var GOTO) or (ON var GOSUB ).
  981.        The ON GOSUB is similar but it places the return address (of the
  982.        statement following the ON GOSUB) onto the stack.  This allows the
  983.        subroutine's RETURN (or RET) statement to operate properly.
  984.        The maximum number of labels per line is 63.
  985. --------------------------------------------------------------------------------
  986.        P+     (default)
  987.        P-
  988.  
  989.        The P+ instruction enables the color attribute for printing, which means
  990.        that all printing is done in the current foreground/background colors.
  991.        The P- instruction disables the color attribute for printing, which means
  992.        that all printing uses the colors (already on the screen) at the current
  993.        print cursor location. The selected setting stays in effect until
  994.        cancelled by the opposite instruction.
  995.        example:  P+ \ ! "test"   'print using current colors
  996.                  P- \ ! "1234"   'print using colors already on the screen
  997. --------------------------------------------------------------------------------
  998.        P@ row,column
  999.  
  1000.        This instruction locates the print cursor at the specified row 
  1001.        (1 to 25) and column (1 to 80).  For example, P@12,40 would locate
  1002.        the print cursor at row 12 and column 40.  This determines where
  1003.        the next print statement will start.  see: PCSR LIM below
  1004. -------------------------------------------------------------------------------
  1005.        PCSR LIM (top_row , leftmost_column , bottom_row , rightmost_column)
  1006.        PCSR LIM
  1007.  
  1008.        The first form, with operands, sets the limits on the print cursor
  1009.        location and the second form, with no operands, restores the limits 
  1010.        to include the entire screen.  Note: This means that printing can only
  1011.        occur within the specified limits.
  1012.        ex: WINDOW (15,35,25,65) 32 \ PCSR LIM (15,35,25,65)
  1013.            'this would force the cursor to stay inside the window
  1014.            'upper-left (row=15,column=35) and lower-right (row=25,column=65)
  1015.  
  1016.        PEEK buffer (row,column) ASCII var
  1017.        PEEK buffer (row,column) ATTR var
  1018.        PEEK buffer (row,column) var var
  1019.  
  1020.        POKE buffer (row,column) ASCII val
  1021.        POKE buffer (row,column) ATTR val
  1022.        POKE buffer (row,column) val val
  1023.  
  1024.        These instructions will allow the program to read (PEEK) or write
  1025.        (POKE) from/to the specified buffer at the location (row,column).
  1026.        Using the ASCII keyword would involve only the character code while
  1027.        using the ATTR keyword would involve only the color attribute.  Using
  1028.        (var var) or (val val) would specify both the ASCII code and the color
  1029.        attribute would be used (in that order).      
  1030.  
  1031.        ex: PEEK 0 (25,80) V1 V2 would read the screen at (row=25,column=80)
  1032.                                 and would put its ASCII value in V1 while
  1033.                                 placing its color attribute value in V2.
  1034. ----------------------------------------------------------------------------
  1035.        PLAY "text..."
  1036.  
  1037.        This instruction 'plays' the specified musical commands through the
  1038.        PC's internal speaker.  A summary of PLAY commands is listed below.
  1039.  
  1040.       < or >  Up or down one octave
  1041.       A-G  Plays A, B, ..., G in current
  1042.            octave (+ = sharp, - = flat)
  1043.       Ln  Sets length of a note (L1 is
  1044.           whole note, L4 is quarter note,
  1045.           etc.)  n = 1-64
  1046.       ML  Each note plays full length
  1047.       MN  Each note plays 7/8 of length
  1048.       MS  Each note plays 3/4 of length
  1049.       Nn  Plays note n (n = 0-84, 0 is a
  1050.           rest)
  1051.       On  Sets current octave (n = 0-6)
  1052.       Pn  Pause for the duration of
  1053.           n quarternotes (n = 1-64)
  1054.       Tn  Sets number of quarter notes per
  1055.           minute (n = 32-255, 120 default
  1056.  
  1057.       e.g. PLAY "O3CDEFGAB"
  1058.       Note: The ShowText PLAY command does NOT allow the playing of background
  1059.       music, therefore your program will -halt- while the music plays!
  1060.       Please see the special note about the string $(buf,row,col,col) in the
  1061.       section labeled programming tricks and tips.
  1062. ----------------------------------------------------------------------------
  1063.        PORT IN port var
  1064.        This instruction reads values from the specified I/O port into the
  1065.        variable (var).  ex: PORT IN 512 V1  read port number 512 into V1
  1066.  
  1067.        PRINT "text........."
  1068.        prints the text at the current location of the print-cursor
  1069.  
  1070.        PRINT CHAR(val)
  1071.        prints the ASCII character whose ASCII code is specified in val.
  1072.  
  1073.        PRINT var,format
  1074.        print the specified variable according to the specified format
  1075.        (characters in format= 1 to 9  L  Z  O  Q)
  1076.        1 to 9 specifies the width of the field (printing 255 would use 3)
  1077.        L means left-justify (if L is not specified the default is right-justify)
  1078.        Z means to pad the field (left-side) with zeros when printing a small #.
  1079.        O or Q means to replace that (reprehensible) slashed-zero with the
  1080.               letter O.
  1081.        ex: PRINT V1,3Q would print V1 right-justified in a 3-column field with
  1082.                        all zeros replaced by the letter O.
  1083.  
  1084.        TTYPE "text......"
  1085.        is the same as print but it has a slight delay between characters
  1086.        like the old teletype machines. This only works for a text string.
  1087.  
  1088.        Note: If a semi-colon (;) is placed at the end of the line, it will
  1089.              leave the print cursor at that position rather than simulate
  1090.              a <cr><lf> (carriage∙return-line∙feed). e.g PRINT "ABC";
  1091.              This is true for all of the PRINT/TTYPE commands.
  1092.              Please see the special note about the string $(buf,row,col,col)
  1093.              in the section labeled programming tricks and tips.
  1094.              The exclamation mark (!) can be used in place of PRINT while (!!)
  1095.              can be used in place of TTYPE.   e.g.  ! "text"  or  !! "text"
  1096. ----------------------------------------------------------------------------
  1097.        PUSH variablelist
  1098.        POP  variablelist
  1099.  
  1100.        These instructions PUSH/POP variables on/off the variable stack. (Note
  1101.        that the variable stack is different from the instruction stack used
  1102.        by the GOSUB/RET/RST S instructions).  The variable list can be 
  1103.        specified in a number of ways. Some examples will show how it works.
  1104.  
  1105.        PUSH 1,2,3 is the same as PUSH V1,V2,V3. (The letter V is optional here)
  1106.  
  1107.        PUSH 1,5-7,9-12 which is the same as PUSH 1,5,6,7,9,10,11,12 should be
  1108.                        followed later in the program by:
  1109.        POP 12-9,7-5,1  because values are POPped off the variable stack in the
  1110.                        opposite order in which they were PUSHed onto the stack.
  1111.  
  1112.        These instructions allow subroutines to push variables onto the stack,
  1113.        then use them in any routines, then pop the original values back into
  1114.        the appropriate variables.  Be sure not to push too many variables onto
  1115.        the stack at any given time because the stack is only 1024 bytes long.
  1116.        e.g. PUSH 0-255\PUSH 0-255\PUSH 0-255\PUSH 0-255 would just fill up the
  1117.             variable stack.  Note that PUSH 0-4 uses less program memory than
  1118.             PUSH 0,1,2,3,4, so PUSHing/POPping a contiguous range of subscripts
  1119.             will be more efficient than a scattered group of subscripts.
  1120.        If you PUSH too many values onto the stack, an error message will be
  1121.        generated.  If you try to POP a value off the stack when there are no
  1122.        values on the stack, the destination target variable will remain 
  1123.        unchanged and no error message will be given.
  1124.  
  1125.        RST KEYCLK  ( or  RST K)
  1126.  
  1127.        This instruction clears the entire 63 byte keyclick buffer and also
  1128.        clears the PC's keyboard buffer.  This allows the program to cancel
  1129.        any type-ahead before executing a particular routine.
  1130. ----------------------------------------------------------------------------
  1131.        RST STACK  ( or RST S)
  1132.  
  1133.        This instruction pops one (RETURN) value off the stack.  This allows
  1134.        a subroutine to return to a different address than the one which called
  1135.        it.  e.g.  RST STACK \ GOTO OTHER
  1136. ----------------------------------------------------------------------------
  1137.        RST T              reset timer number 0
  1138.        RST Tn             reset timer number n (n=0 to 15 or math expression)
  1139.        RST TS             reset all timerS
  1140.  
  1141.        This instruction resets the specified 16 bit-timer to zero.  The timers
  1142.        have a range of 0 to 3600 seconds and measure the time since the last
  1143.        RST Tn instruction was executed.
  1144.        example: RST TS    would reset ALL 16 timers to zero
  1145.                 RST T15   would reset timer number 15 to zero
  1146.                 RST T%i   would reset timer number %i to zero
  1147. ----------------------------------------------------------------------------
  1148.        RESTART
  1149.  
  1150.        This instruction simply restarts the current program with all variables
  1151.        reset to zero.
  1152. ----------------------------------------------------------------------------
  1153.        SAVE
  1154.        Saves the current visible screen in the special buffer area.
  1155.  
  1156.        RESTORE fade 
  1157.        Restores the screen from the special buffer area (with an optional fade).
  1158.  
  1159.        Note: These two commands access buffer 66. The SAVE/RESTORE combination
  1160.        not only saves and restores the screen itself, but also saves and
  1161.        restores ALL screen parameters such as print colors, cursor location etc.
  1162.        This is useful before and after a (WINDOW / user input) routine.
  1163.        ex: SAVE\CLS\RESTORE 1 'save-screen,clear-screen,restore-screen w/fade=1
  1164. -------------------------------------------------------------------------------
  1165.        SCREENSAVER val
  1166.  
  1167.        This instruction implements a screensaver function which is invoked
  1168.        when no key/mouse buttons are pressed for the specified time (in
  1169.        minutes).  The screensaver is disabled if the value (val) is zero.
  1170.        Interactive programs would probably benefit from the use of this
  1171.        function while constantly-running demo programs which require no user
  1172.        input would probably not need it.
  1173.        ex: SCREENSAVER 1 'would active screen-saver after 1 minute of inactivity
  1174. -------------------------------------------------------------------------------
  1175.        SCROLL UP (row1,col1,row2,col2)
  1176.        SCROLL DOWN (row1,col1,row2,col2)
  1177.  
  1178.        These instructions will cause the text inside the block at
  1179.        (upper-left=row1,col1  lower-right=row2,col2) to scroll one line
  1180.        in the specified direction.  The resultant blank line will be shown in
  1181.        the default foreground/background color.
  1182.        ex: SCROLL UP (1,1,25,80) would scroll entire screen up
  1183.  
  1184.        SELECT CASE test_expression
  1185.           ∙∙∙
  1186.           ∙∙∙statements_block1
  1187.           ∙∙∙
  1188.        CASE case_expression{,case_expression...}
  1189.           ∙∙∙
  1190.           ∙∙∙statements_block2
  1191.           ∙∙∙
  1192.        CASE ELSE
  1193.           ∙∙∙
  1194.           ∙∙∙statements_block3
  1195.           ∙∙∙
  1196.        END SELECT
  1197.  
  1198.        This group of instructions will allow your program to execute specific
  1199.        blocks of code depending upon the relationship between the 
  1200.        test_expression and the case_expression(s).  The SELECT CASE statement
  1201.        establishes the value against which all of the case_expressions are
  1202.        compared.  The test_expression and case_expression(s) can be any
  1203.        mathematical expressions.  In addition, the case_expression can also
  1204.        be in the form  value1 TO value2 (e.g. 4 TO 5 )(note: value1 must be 
  1205.        less than value2).  It can also be in the form  {relational_operator}
  1206.        value (e.g. <5).  More than one case expression can be placed on a
  1207.        line by separating them with a comma.  The CASE ELSE statement is used
  1208.        to handle any conditions not covered by previous CASE statements.  Note
  1209.        that the CASE ELSE statement is optional.
  1210.  
  1211.        Example 1
  1212.        %j=4 \ for %i=1 to 10
  1213.        SELECT CASE %i  'could also have been a mathematical expression
  1214.             print "statements before first case are always executed"
  1215.        CASE 1
  1216.             print "it was a 1"
  1217.        CASE 2 TO 3,>=9
  1218.             print "it was either 2,3,9 or 10"
  1219.        CASE %j+2,%j*2
  1220.             print "it was a 6 or an 8"
  1221.        CASE ELSE
  1222.             print "if all else fails it was 4,5 or 7"
  1223.        END SELECT       
  1224.  
  1225.        Example 2 (note that CASE ELSE is not used)
  1226.        for %i=1 to 10
  1227.        SELECT CASE %i AND 1
  1228.        print %i,3q;
  1229.        CASE 0 \ print " is an even number"
  1230.        CASE 1 \ print " is an odd number"
  1231.        END SELECT
  1232.  
  1233.        System Variables - (  be sure to use the square brackets  [ ]   )
  1234.        [info] returns the specified information where [info] can be:
  1235.  
  1236.        [RANDOM num1 TO num2]
  1237.        returns a random number within the range num1 to num2.
  1238.        Note: Num1 and Num2 are numbers (0 to 255) and cannot be variables.
  1239.  
  1240.        [X]     (the EXTRA variable used in most arithmetic operations)
  1241.        [OVR]   (the OVERFLOW variable  =255 if overflow    =0 if no overflow)
  1242.                 this variable can only be reset to 0 by reading it 
  1243.                 e.g.  if [OVR] quit
  1244.               
  1245.        -----------------Keyclick Values----------------------------------------
  1246.        [K]     ( most recent keyclick KEY value)
  1247.        [KC]    ( most recent keyclick KEY value (capitalized) )
  1248.        [.R]    ( most recent keyclick row value)
  1249.        [.C]    ( most recent keyclick column value)
  1250.        [.AS]   ( ASCII value of the character located on-the-screen
  1251.                 at the most recent keyclick row,column coordinates)
  1252.        [.AT]   ( ATTRIBUTE value of the character located
  1253.                 on-the-screen at the most recent keyclick row,col coordinates)
  1254.        [.F]    ( foreground color value of the character located
  1255.                 on-the-screen at the most recent keyclick row,col coordinates)
  1256.        [.B]    ( background color value of the character located
  1257.                 on-the-screen at the most recent keyclick row,col coordinates)
  1258.                 --note-- [.AS] [.AT] [.F] [.B] are always determined from
  1259.                          the visible screen regardless of the VIRTUAL setting.
  1260.  
  1261.        -----------------Screen Cursor Values-----------------------------------
  1262.        [CV]    ( cursor visibility status  0=Cursor OFF and 255=cursor ON)
  1263.        [R.]    ( row on which the cursor currently resides)
  1264.        [C.]    ( column on which the cursor currently resides)
  1265.        [AS.]   ( ASCII value of the character located on-the-screen
  1266.                 at the current cursor row,column coordinates)
  1267.        [AT.]   ( ATTRIBUTE value of the character located
  1268.                 on-the-screen at the current cursor row,col coordinates)
  1269.        [F.]    ( foreground color value of the character located
  1270.                 on-the-screen at the current cursor row,col coordinates)
  1271.        [B.]    ( background color value of the character located
  1272.                 on-the-screen at the current cursor row,col coordinates)
  1273.                 --note-- [AS.] [AT.] [F.] [B.] are always determined from
  1274.                          the visible screen regardless of the VIRTUAL setting.
  1275.        [-R.]     minimum cursor row value────┐ 
  1276.        [+R.]     maximum cursor row value    ├─set by the last
  1277.        [-C.]     minimum cursor column value │ CSR LIM  
  1278.        [+C.]     maximum cursor column value─┘ command executed
  1279.              
  1280.        -----------------Print Cursor Values------------------------------------
  1281.        [R;]    ( row on which the print-cursor currently resides)
  1282.        [C;]    ( column on which the print-cursor currently resides)
  1283.        [AT;]   ( current foreground/background attribute byte) for printing
  1284.        [F;]    ( current foreground color 0 to 31) for printing
  1285.        [B;]    ( current background color 0 to 7)  for printing
  1286.        [-R;]     minimum print cursor row value────┐ 
  1287.        [+R;]     maximum print cursor row value    ├─set by the last
  1288.        [-C;]     minimum print cursor column value │ PCSR LIM  
  1289.        [+C;]     maximum print cursor column value─┘ command executed
  1290.  
  1291.        System variables - continued
  1292.  
  1293.        [BIOSn] returns the value of the byte located at (decimal) offset n from
  1294.                the start of the BIOS data area (in low memory at 0040:0000h)
  1295.                (see the appendix for more information about this area)
  1296.        [VIRT]  returns the current virtual buffer number (last set by VIRTUAL)
  1297.                (i.e. where CLS, PRINT, COPY (%buffer,0) etc. are performed)
  1298.                if =0 then printing goes to visible screen (virtual mode is off)
  1299.                if<>0 then printing goes to specified buffer (virtual mode is on)
  1300.  
  1301.        [M?]    255 if mouse present    0 if no mouse was found
  1302.        [MB]    255 if any mouse button pressed         0 otherwise
  1303.        [ML]    255 if left mouse button pressed        0 otherwise
  1304.        [MR]    255 if right mouse button pressed       0 otherwise
  1305.        [MC]    255 if center mouse button pressed      0 otherwise
  1306.  
  1307.        [JAX]   joystick A analog (X) value (0 to 255)
  1308.        [JAY]   joystick A analog (Y) value (0 to 255)
  1309.        [JBX]   joystick B analog (X) value (0 to 255)
  1310.        [JBY]   joystick B analog (Y) value (0 to 255)
  1311.        [JAF]   255 if joystick A fire button pressed ( 0 otherwise)
  1312.        [JAB]   255 if joystick A base button pressed ( 0 otherwise)
  1313.        [JBF]   255 if joystick B fire button pressed ( 0 otherwise)
  1314.        [JBB]   255 if joystick B base button pressed ( 0 otherwise)
  1315.  
  1316.        [Tn]    (returns the least significant 8 bits of the specified 16 bit
  1317.                timer's value while the most significant 8 bits are placed in
  1318.                the EXTRA variable)  (n=0 to 15)  e.g. V2=[T0] \ V3=[X]
  1319.                (Note: "n" can also be a math expression   e.g. [T%i+1] 
  1320.                       These values are in clock-ticks and are NOT in seconds
  1321.                       There are approximately 18.2 clock-ticks in one second.)
  1322.        [RND]   with no arguments - returns a random number between 0 and 255
  1323.        [STK]   ( instruction stack pointer i.e. level of subroutine)
  1324.        [ERL]   ( current DOS ERRORLEVEL value)
  1325.        [DIR]   returns the state of the internal directory pointer
  1326.                0=no files in directory
  1327.                1=now pointing to first directory entry (i.e. after DIRTOP cmd)
  1328.                2=now pointing to last  directory entry (i.e. after DIRBOT cmd)
  1329.                3=pointing to first and last entry (i.e. only 1 file in library)
  1330.                4=now pointing to somewhere between first and last entries
  1331.  
  1332.      ┌────────────────────────────────────────────────────────────────────┐
  1333.      │   The following values are available on AT class PCs with CMOS RAM │
  1334.      │ [YR]   ( tens of years e.g. 1995 would return 95)                  │
  1335.      │ [MON]  ( current month 1 to 12)                                    │
  1336.      │ [DAY]  ( current day 1 to 31)                                      │
  1337.      │ [HR]   ( hour in 24 hr format eg. 1 pm = 13)                       │
  1338.      │ [MIN]  ( minutes e.g. 12:34 = 34 )                                 │
  1339.      │ [SEC]  ( seconds eg. 12:34:56 = 56 )                               │
  1340.      └────────────────────────────────────────────────────────────────────┘
  1341.  
  1342.        System variables - continued
  1343.  
  1344.        [.row1:column1:row2:column2] is 225 if last click was in "box"
  1345.                                     is 0 if not
  1346.  
  1347.        [row1:column1:row2:column2.] is 225 if cursor is currently in "box"
  1348.                                     is 0 if not
  1349.  
  1350.        [AS:buf:row:col]  returns the AScii value of the character located
  1351.                          in buffer "buf" at the specified row and column
  1352.    
  1353.        [AT:buf:row:col]  returns the ATtribute-byte value of the character
  1354.                          located in buffer "buf" at the specified row and column
  1355.    
  1356.        [FB:fg:bg] returns the corresponding attribute value of the specified
  1357.                   foreground and background colors. 
  1358.                   e.g. [FB:31:1] uses 31=(blinking bright white foreground) and
  1359.                                        1=(blue background)
  1360.                   returns 159 (see ATTR and COLOR commands for values)
  1361.                   The commands COLOR 31,1 and ATTR [FB:31:1] are equivalent.
  1362.  
  1363.        [IR:lowval:testval:highval] is 255 if testval is InRange , 0 if not
  1364.  
  1365.        [TM:lowval:timer#:highval] checks to see if specified timer is in-range
  1366.         returns 255 if specified timer(in ticks) is InRange , 0 if not
  1367.         e.g [TM:25:7:35] checks the ticks-value of timer number 7 to see if it
  1368.         is between 25 and 35 inclusive.
  1369.  
  1370.    >>> Note the use of colons (:) instead of commas (,) in some of these
  1371.        system variables. This makes parsing of the command more straightforward.
  1372.  
  1373.        ex: V0=[K] places the most recent keyclick value into V0
  1374.  
  1375.        var=val
  1376.        var++          (increment var by 1)  ex: V7++ is the same as V7=V7+1
  1377.        var--          (decrement var by 1)  ex: V7-- is the same as V7=V7-1
  1378.        var=val^val    (exponentiation)
  1379.        var=val*val    (multiplication)
  1380.        var=val/val    (division)
  1381.        var=val~val    (modulo division - returns the remainder of val/val)
  1382.        var=val+val    (addition)
  1383.        var=val-val    (subtraction)
  1384.        var=val<val    (less than)----------------always 0(false) or 255(true)
  1385.        var=val=val    (equal to)-----------------always 0(false) or 255(true)
  1386.        var=val>val    (greater than)-------------always 0(false) or 255(true)
  1387.        var=val<=val   (less than or equal to)----always 0(false) or 255(true)
  1388.        var=val<>val   (not equal to)-------------always 0(false) or 255(true)
  1389.        var=val>=val   (greater than or equal to)-always 0(false) or 255(true)
  1390.        var=`val       (same as var= NOT val)     note:symbol is ascii 96
  1391.        var=val&val    (same as var=val AND val)
  1392.        var=val@val    (same as var=val OR val)──────┬──alternate OR symbols
  1393.        var=val|val    (same as var=val OR val)──────┘
  1394.        var=val#val    (same as var=val XOR val)
  1395.  
  1396.        var is a variable (V0 to V255) or an indexed variable (VV0 to VV255).
  1397.        val can also be a variable, an indexed variable or a number (0 to 255).
  1398.        A variable is similar to an array element. V0 to V255 is similar to
  1399.        V(0) to V(255) in some other languages.  An indexed variable uses the
  1400.        contents of another variable as an index. VV0 to VV255 is similar to
  1401.        V(V(0)) to V(V(255)).  There are still only 256 variables in the 
  1402.        system.  Indexing only allows more options for the programmer. 
  1403.        These instructions perform the specified (integer) math operation.
  1404.        The variables have unsigned 8-bit values which means that they may
  1405.        only contain numbers from 0 to 255.  The AND,OR and XOR are bitwise
  1406.        logic instructions.  The EXTRA variable [X] is used to hold the overflow
  1407.        and underflow of the math operations.  The overflow variable [OVR] is
  1408.        set to 255 if ANY math over/underflow occurs.  OVR is reset to zero 
  1409.        ONLY when it is read.
  1410.  
  1411.        Notes:
  1412.        These instructions can be embedded in normal instructions,
  1413.        e.g.  %A = (%B + 45) * ((%C + 1) / 4)
  1414.        however you must remember that there are NO negative values in ShowText.
  1415.        This means that  %A = 3-2  is NOT the same as  %A= -2+3 .
  1416.        The EXTRA variable's value is set by the LAST math operation performed.
  1417.        If you use the literal AND,OR,XOR forms instead of the &,@,# forms, then
  1418.        you M-U-S-T include a space on either side of the word.  This allows the
  1419.        command parser to function properly.
  1420.        Example: %Temp = %Misc OR %Other  'correct
  1421.                 %Temp = %MiscOR%Other    'incorrect - use  %Temp = %Misc@%Other
  1422.        The order of execution of mathematical operations is:
  1423.            1st - parentheses         ( )
  1424.            2nd - exponentiation       ^
  1425.            3rd - multiplication       *
  1426.            4th - division and modulo  /   ~
  1427.            5th - add  subtract        +   -
  1428.            6th - relational           <   =   >   <=   <>   >=
  1429.            7th - logical NOT          `
  1430.            8th - logical              &   @   |   #
  1431.  
  1432.        VIRTUAL val
  1433.  
  1434.        Sets the address used by buffer 0 to the specified buffer's address.
  1435.        For example, VIRTUAL 2 means that CLS, PRINT, COPY(4,0) etc. would
  1436.        perform their actions on buffer 2 instead of on the visible screen.
  1437.        VIRTUAL 0 would change the address of buffer 0 to the visible screen.
  1438. ----------------------------------------------------------------------------
  1439.        WAIT seconds             {or WT}
  1440.  
  1441.        where seconds is 0 to 3600.8 seconds and represents how long the
  1442.        program should wait. ex: WAIT 2 would pause program for two seconds
  1443. ----------------------------------------------------------------------------
  1444.        WAITKEY seconds          {or WK seconds}
  1445.        WAITKEY seconds,label    {or WK seconds,label}
  1446.        WAITKEY                  {or WK}
  1447.  
  1448.        where seconds is 0 to 3600 seconds and represents how long the
  1449.        program should wait for a key/mouse button press.
  1450.        ex: WAITKEY 10,TOOLATE would retrieve a keyclick pressed within
  1451.            ten seconds and then continue execution at the next statement,
  1452.            otherwise if no key/mouse is pressed within ten seconds a
  1453.            GOTO TOOLATE would be executed.
  1454.  
  1455.        When the user presses a key (or a mouse button), the ShowText system
  1456.        generates three things: a KEY (0 to 255) value , a ROW CLICK
  1457.        (row 1 to 25) value and a COLUMN CLICK (column 1 to 80) value.  These
  1458.        values are placed in a 63 byte circular (first-in-first-out) buffer.
  1459.        The O-N-L-Y way to make these values available to the program is to
  1460.        execute a WAITKEY command.  The WAITKEY command retrieves the next
  1461.        character in the keyclick buffer.  If no user input is waiting then
  1462.        KEY=0 (NULL), ROW CLICK=0 and COLUMN CLICK=0. 
  1463.  
  1464.        The first form of the instruction will cause execution to continue at
  1465.        the statement following the WAITKEY statement whenever a key/mouse
  1466.        button is pressed or when the time interval has expired.
  1467.        The second form of the instruction will cause execution to continue at
  1468.        the statement following the WAITKEY statement only if a key/mouse button
  1469.        is pressed.  If the time interval expires before a key/mouse button is
  1470.        pressed, execution continues at the specified label (like GOTO label).
  1471.        The third form waits indefinitely for a key/mouse-press then continues.
  1472.  
  1473.        WHILE condition
  1474.        ∙∙∙
  1475.        ∙∙∙statements∙∙∙
  1476.        ∙∙∙
  1477.        WEND
  1478.  
  1479.        The WHILE-loop is performed as long as the condition is true.  For
  1480.        example, the following program will print the numbers 1 through 5.
  1481.  
  1482.          %I=1
  1483.          WHILE %I<=5
  1484.          PRINT %I,3Q
  1485.          %I++
  1486.          WEND
  1487.  
  1488.        Special Note: The GOWEND instruction can be used to perform a GOTO to
  1489.        the next WEND instruction as if a label was assigned to it. The
  1490.        EXITWHILE/XWHILE instructions can be used to perform a GOTO to the
  1491.        instruction immediately following the next WEND instruction.  These
  1492.        instructions will properly handle nested WHILE/WEND loops, so that a
  1493.        GOWEND (or EXITWHILE or XWHILE) in an outer loop will seek the
  1494.        appropriate WEND instruction.
  1495. ----------------------------------------------------------------------------
  1496.        WINDOW (row1,col1,row2,col2) windowtype
  1497.        WINDOW (row1,col1,row2,col2) windowtype,attribute
  1498.  
  1499.        The first instruction will draw a window (with current colors) between
  1500.        the upper-left (row1,col1) and the lower-right (row2,col2) positions
  1501.        on the screen. The interior of the window is painted with current colors.
  1502.        Text may then be inserted inside the window with the print statement etc.
  1503.        The windowtype value may be a number or variable.
  1504.            window       ┌───┐   ╒═══╕   ╓───╖    ╔═══╗
  1505.            types:       │100│   │101│   ║102║    ║103║    Type 104=MARQUEE
  1506.                         └───┘   ╘═══╛   ╙───╜    ╚═══╝
  1507.        ex: WINDOW (1,1,25,80) 100 places single-line window around entire screen
  1508.        NOTE: Type 104 generates a "marquee" around the specified box in low
  1509.        intensity current colors.  This type of window differs from all others
  1510.        because the inside of the box is "clear" (i.e. it is not painted over
  1511.        by this instruction and can be followed by a BFILL instruction).
  1512.        Values outside the range of 100 to 104 will place the ASCII character
  1513.        code (val) around the perimeter of the window.  See TIPS/TRICKS section.
  1514.        The second form allows an optional attribute value. See ATTR command.
  1515.  
  1516.        XFLOAD "filename.ext"
  1517.        XFSAVE "filename.ext"
  1518.  
  1519.        These two instructions ( XFLOAD - e<X>ternal <F>ile <LOAD> and
  1520.        XFSAVE - e<X>ternal <F>ile <SAVE> ) allow your program to
  1521.        load-screen-from/save-screen-to external files.  These files are always
  1522.        screen images like the .STF file format.  The extension MUST be specified
  1523.        with these instructions, because there is no assumed default extension.
  1524.        These files are NOT imbedded into the .EXE at compile time as the
  1525.        files used with the COPY command are.  The screen (buffer 0) is the
  1526.        default source/destination, but you can use the VIRTUAL command to
  1527.        temporarily point to another buffer as the source for XFSAVE or the
  1528.        destination for XFLOAD.  The EXTRA system variable is set to 255 if an
  1529.        error occurred or is reset to zero if no error occurred (in opening the
  1530.        specified disk file).
  1531.     >>>Note: All ASCII zero and ASCII 255 characters, on the screen
  1532.        (or virtual screen), are converted to ASCII 32 (space) characters (in the
  1533.        output file) when the XFSAVE instruction is called.
  1534.     >>>Note: Do NOT use buffer number 65 as the virtual screen, when using the
  1535.        XFSAVE/XFLOAD instructions, because it is a reserved area used to process
  1536.        these two instructions.
  1537.  
  1538.        Compiler Directives
  1539. ----------------------------------------------------------------------------
  1540.        $DOS command
  1541.  
  1542.        This compiler directive SHELLs to DOS, executes the command, then returns
  1543.        to the compiler to finish compiling the remainder of the program.
  1544.        Note: This is a compiler directive and NOT a programming instruction.
  1545.        Ex: $DOS dir *.*
  1546. ----------------------------------------------------------------------------
  1547.        $LIB ADD filespec
  1548.        $LIB ADD filespec1,filespec2,...,...,filespecN
  1549.  
  1550.        The COPY(sourcefile,destinationbuffer)fade command automatically adds the
  1551.        specified sourcefile.STF to the internal library.
  1552.        The $LIB ADD directive was added to aid in the use of the 
  1553.        COPY ( $(bfr,row,col1,col2), dest)fade command, because this form of
  1554.        the COPY command performs a filename search on the internal library
  1555.        directory.  The $LIB ADD directive is used to make sure that all needed
  1556.        files are added to the internal library.
  1557.        The $LIB ADD directive will add all files (matching the filespec(s)
  1558.        in the current directory) to the internal library.  The default (and
  1559.        only) allowable extension is .STF.  Note that ALL files must be in
  1560.        the CURRENT directory.  NO drives:\directories can be specified!
  1561.        Note: See the $LIB DIR directive to find out how to override the default
  1562.              (current) directory used to store .STF files.
  1563.        Ex: $LIB ADD *.STF
  1564.            'adds all .STF files in the current directory
  1565. ----------------------------------------------------------------------------
  1566.        $LIB DIR "directoryname"
  1567.  
  1568.        This optional directive changes the directory that is used to access the
  1569.        .STF files. It should only be done once and it can only be done BEFORE
  1570.        any .STF files are added to the internal library. Note that the 
  1571.        double-quotes (") MUST be used because the backslash (\) is normally
  1572.        used to start a new program line.  
  1573.        Ex: $LIB DIR "\TEMP"
  1574.            'followed by
  1575.            $LIB ADD *.STF
  1576.            'would load all .STF files in the \TEMP directory (i.e. \TEMP\*.STF)
  1577.  
  1578.        NUMERIC KEYCODE VALUES RETURNED BY THE   var=[K]   COMMAND
  1579.  
  1580.             ┌─────┬─────┬─────┬─────┐             ┌─────┬─────┬─────┬─────┐
  1581.        key  │     │SHIFT│ CTRL│ ALT │        key  │     │SHIFT│ CTRL│ ALT │
  1582.     ┌───────┼─────┼─────┼─────┼─────┤     ┌───────┼─────┼─────┼─────┼─────┤
  1583.     │   A   │  65 │  97 │   1 │ 158 │     │  ESC  │  27 │  27 │  27 │  -  │
  1584.     │   B   │  66 │  98 │   2 │ 176 │     │ BKSP  │   8 │   8 │ 127 │  -  │
  1585.     │   C   │  67 │  99 │   3 │ 174 │     │  TAB  │   9 │ 143 │  -  │  -  │
  1586.     │   D   │  68 │ 100 │   4 │ 160 │     │ SPACE │  32 │  32 │  32 │  32 │
  1587.     │   E   │  69 │ 101 │   5 │ 146 │     │ ENTER │  13 │  13 │  10 │  -  │
  1588.     │   F   │  70 │ 102 │   6 │ 161 │     │  F1   │ 187 │ 212 │ 222 │ 232 │
  1589.     │   G   │  71 │ 103 │   7 │ 162 │     │  F2   │ 188 │ 213 │ 223 │ 233 │
  1590.     │   H   │  72 │ 104 │   8 │ 163 │     │  F3   │ 189 │ 214 │ 224 │ 234 │
  1591.     │   I   │  73 │ 105 │   9 │ 151 │     │  F4   │ 190 │ 215 │ 225 │ 235 │
  1592.     │   J   │  74 │ 106 │  10 │ 164 │     │  F5   │ 191 │ 216 │ 226 │ 236 │
  1593.     │   K   │  75 │ 107 │  11 │ 165 │     │  F6   │ 192 │ 217 │ 227 │ 237 │
  1594.     │   L   │  76 │ 108 │  12 │ 166 │     │  F7   │ 193 │ 218 │ 228 │ 238 │
  1595.     │   M   │  77 │ 109 │  13 │ 178 │     │  F8   │ 194 │ 219 │ 229 │ 239 │
  1596.     │   N   │  78 │ 110 │  14 │ 177 │     │  F9   │ 195 │ 220 │ 230 │ 240 │
  1597.     │   O   │  79 │ 111 │  15 │ 152 │     │  F10  │ 196 │ 221 │ 231 │ 241 │
  1598.     │   P   │  80 │ 112 │  16 │ 153 │     │  F11  │  -  │  -  │  -  │  -  │
  1599.     │   Q   │  81 │ 113 │  17 │ 144 │     │  F12  │  -  │  -  │  -  │  -  │
  1600.     │   R   │  82 │ 114 │  18 │ 147 │     │ UP    │ 2OO │ 2OO │  -  │  -  │
  1601.     │   S   │  83 │ 115 │  19 │ 159 │     │ DOWN  │ 2O8 │ 2O8 │  -  │  -  │
  1602.     │   T   │  84 │ 116 │  20 │ 148 │     │ LEFT  │ 2O3 │ 2O3 │ 243 │  -  │
  1603.     │   U   │  85 │ 117 │  21 │ 150 │     │ RIGHT │ 2O5 │ 2O5 │ 244 │  -  │
  1604.     │   V   │  86 │ 118 │  22 │ 175 │     │ INS   │ 210 │ 210 │  -  │  -  │
  1605.     │   W   │  87 │ 119 │  23 │ 145 │     │ DEL   │ 211 │ 211 │  -  │  -  │
  1606.     │   X   │  88 │ 120 │  24 │ 173 │     │ HOME  │ 199 │ 199 │ 247 │  -  │
  1607.     │   Y   │  89 │ 121 │  25 │ 149 │     │ END   │ 207 │ 207 │ 245 │  -  │
  1608.     │   Z   │  90 │ 122 │  26 │ 172 │     │ PGUP  │ 201 │ 201 │ 101 │  -  │
  1609.     │ 0 or )│  48 │  41 │  -  │  -  │     │ PGDN  │ 209 │ 209 │ 246 │  -  │
  1610.     │ 1 or !│  49 │  33 │  -  │ 248 │     │ - or _│  45 │  95 │  31 │  -  │
  1611.     │ 2 or @│  50 │  64 │ 131 │ 249 │     │ + or =│  61 │  43 │  -  │  -  │
  1612.     │ 3 or #│  51 │  35 │  -  │ 250 │     │ | or \│  92 │ 124 │  28 │  -  │
  1613.     │ 4 or $│  52 │  36 │  -  │ 251 │     │ { or [│  91 │ 123 │  27 │  -  │
  1614.     │ 5 or %│  53 │  37 │  -  │ 252 │     │ ] or }│  93 │ 125 │  29 │  -  │
  1615.     │ 6 or ^│  54 │  94 │  30 │ 253 │     │ : or ;│  59 │  58 │  -  │  -  │
  1616.     │ 7 or &│  55 │  38 │  -  │ 254 │     │ " or '│  39 │  34 │  -  │  -  │
  1617.     │ 8 or *│  56 │  42 │  -  │ 255 │     │ < or ,│  44 │  60 │  -  │  -  │
  1618.     │ 9 or (│  57 │  40 │  -  │  -  │     │ > or .│  46 │  62 │  -  │  -  │
  1619.     │ ` or ~│  96 │ 126 │  -  │  -  │     │ ? or /│  47 │  63 │  -  │  -  │
  1620.     └───────┴─────┴─────┴─────┴─────┘     └───────┴─────┴─────┴─────┴─────┘
  1621.  
  1622. ┌──────────────────────────────────────────────────────────────────────────────┐
  1623. │                               SHOWTEXT FADES                                 │
  1624. ├──────────────────┬┬──────────────────┬┬──────────────────┬┬──────────────────┤
  1625. │ O Quick          ││19 Spiral CW In   ││38 Wipe V Close   ││57 Circ Sweep Down│
  1626. │ 1 Fizz           ││2O Spiral CW Out  ││39 Half Wipe V U/D││58 Circ Sweep Up  │
  1627. │ 2 Melt Down      ││21 Spiral CCW In  ││4O Half Wipe V D/U││59 Radar CW       │
  1628. │ 3 Melt Up        ││22 Spiral CCW Out ││41 Half Wipe H L/R││6O Radar CCW      │
  1629. │ 4 Liquid Flow Dn ││23 Mult Sp CW In  ││42 Half Wipe H R/L││61 Louver H Large │
  1630. │ 5 Liquid Flow Up ││24 Mult Sp CW Out ││43 Checker Down   ││62 Louver H Small │
  1631. │ 6 Quarters - CW  ││25 Mult Sp CCW In ││44 Checker Up     ││63 Louver V Large │
  1632. │ 7 Quarters - CCW ││26 Mult Sp CCW Out││45 Diagonal Right ││64 Louver V Small │
  1633. │ 8 Quarters - Alt ││27 Wipe Down      ││46 Diagonal Left  ││                  │
  1634. │ 9 Blks Random Lg ││28 Wipe Up        ││47 Chckr Lvr 1step││                  │
  1635. │1O Blks Random Sm ││29 Wipe Right     ││48 Chckr Lvr 2step││                  │
  1636. │11 Zigzag H Lg Rt ││3O Wipe Left      ││49 Diagonal Lvr R ││                  │
  1637. │12 Zigzag H Lg Lft││31 Curtain H Open ││5O Diagonal Lvr L ││                  │
  1638. │13 Zigzag H Sm Rt ││32 Curtain H Close││51 Page Feed Down ││                  │
  1639. │14 Zigzag H Sm Lft││33 Curtain V Open ││52 Page Feed Up   ││                  │
  1640. │15 Zigzag V Down  ││34 Curtain V Close││53 Page Feed Right││                  │
  1641. │16 Zigzag V Up    ││35 Wipe H Open    ││54 Page Feed Left ││255 selects a     │
  1642. │17 Orifice Open   ││36 Wipe H Close   ││55 Circ Sweep CW  ││    random fade   │
  1643. │18 Orifice Close  ││37 Wipe V Open    ││56 Circ Sweep CCW ││    from this list│
  1644. └──────────────────┴┴──────────────────┴┴──────────────────┴┴──────────────────┘
  1645. Note: The program FADES.EXE will demonstrate each of these fades.
  1646.  
  1647. Useful information from the BIOS Data Area located at 0040:0000h in low memory
  1648. ────────────────────────────────────┬─┬─┬─┬─┬─┬─┬─┬─┬──────────────────────────
  1649.                                  Bit│7│6│5│4│3│2│1│0│ Meaning
  1650. ────────────────────────────────────┼─┼─┼─┼─┼─┼─┼─┼─┼──────────────────────────
  1651. [BIOS23]  = keyboard status byte #1 │x│ │ │ │ │ │ │ │1=insert mode active
  1652.                                     │ │x│ │ │ │ │ │ │1=caps lock mode active
  1653.                                     │ │ │x│ │ │ │ │ │1=num lock mode active
  1654.                                     │ │ │ │x│ │ │ │ │1=scroll lock mode active
  1655.                                     │ │ │ │ │x│ │ │ │1=either alt key held down
  1656.                                     │ │ │ │ │ │x│ │ │1=either ctrl key held down
  1657.                                     │ │ │ │ │ │ │x│ │1=left shift key held down
  1658.                                     │ │ │ │ │ │ │ │x│1=right shift key held down
  1659. ────────────────────────────────────┼─┼─┼─┼─┼─┼─┼─┼─┼──────────────────────────
  1660. [BIOS24]  = keyboard status byte #2 │x│ │ │ │ │ │ │ │1=insert key held down
  1661.                                     │ │x│ │ │ │ │ │ │1=caps lock key held down
  1662.                                     │ │ │x│ │ │ │ │ │1=num lock key held down
  1663.                                     │ │ │ │x│ │ │ │ │1=scroll lock key held down
  1664.                                     │ │ │ │ │x│ │ │ │1=pause mode active
  1665.                                     │ │ │ │ │ │x│ │ │1=SysReq key held down
  1666.                                     │ │ │ │ │ │ │x│ │1=left alt key held down
  1667.                                     │ │ │ │ │ │ │ │x│1=left ctrl key held down
  1668. ────────────────────────────────────┼─┼─┼─┼─┼─┼─┼─┼─┼──────────────────────────
  1669. [BIOS150] = keyboard status byte #3 │x│ │ │ │ │ │ │ │read ID in progress
  1670.                                     │ │x│ │ │ │ │ │ │last char was 1st ID char
  1671.                                     │ │ │x│ │ │ │ │ │force num lock if ID&KBX
  1672.                                     │ │ │ │x│ │ │ │ │101/102-key kbd installed
  1673.                                     │ │ │ │ │x│ │ │ │1=right alt key held down
  1674.                                     │ │ │ │ │ │x│ │ │1=right ctrl key held down
  1675.                                     │ │ │ │ │ │ │x│ │last code was E0 hidden
  1676.                                     │ │ │ │ │ │ │ │x│last code was E1 hidden
  1677. ────────────────────────────────────┼─┼─┼─┼─┼─┼─┼─┼─┼──────────────────────────
  1678. [BIOS151] = keyboard LED flags      │x│ │ │ │ │ │ │ │kbd xmit error flag
  1679.                                     │ │x│ │ │ │ │ │ │mode indicator update
  1680.                                     │ │ │x│ │ │ │ │ │resend receive flag
  1681.                                     │ │ │ │x│ │ │ │ │ack rcvd
  1682.                                     │ │ │ │ │x│ │ │ │reserved (must be 0)
  1683.                                     │ │ │ │ │ │x│x│x│kbd LED state bits
  1684. ────────────────────────────────────┴─┴─┴─┴─┴─┴─┴─┴─┴──────────────────────────
  1685.  
  1686. [BIOS80]  = cursor column (0 to 79 instead of 1 to 80) 
  1687. [BIOS81]  = cursor row    (0 to 24 instead of 1 to 25)
  1688. [BIOS96]  = cursor type   (ending scan line)
  1689. [BIOS97]  = cursor type   (beginning scan line)
  1690.  
  1691. ───────────────────────────────────────────────────────────────────────────────
  1692.  
  1693. [BIOS108] = system timer ticks (LSB) ──┬──4-byte value
  1694. [BIOS109] = system timer ticks         │
  1695. [BIOS110] = system timer ticks         │
  1696. [BIOS111] = system timer ticks (MSB) ──┘
  1697.  
  1698. ───────────────────────────────────────────────────────────────────────────────
  1699. For example, to see if either shift key is being pressed,
  1700.  
  1701. IF [BIOS23]&3 THEN do_something....
  1702.  
  1703. PROGRAMMING TRICKS AND TIPS
  1704.  
  1705. The following pieces of program code will demonstrate a variety of programming
  1706. principles.  Note that the backslash (\) allows multiple statements on a line.
  1707.  
  1708. 'TO WAIT FOR A KEYSTROKE - NO MATTER HOW LONG IT TAKES
  1709. :CHKIN \ WAITKEY 3600.8,CHKIN
  1710.  
  1711. 'TO EXECUTE A LOOP UNTIL ANY KEY IS PRESSED
  1712. :LOOPIT
  1713. 'any statements here would be executed once during each loop iteration
  1714. WAITKEY 0,LOOPIT
  1715.  
  1716. 'TO EXECUTE A LOOP UNTIL A KEY (OR MOUSE BUTTON) IS PRESSED WHILE THE CURSOR
  1717. 'IS WITHIN THE SPECIFIED BLOCK (WHICH IN THIS CASE IS DEFINED USING VARIABLES)
  1718. :LOOPIT
  1719. 'any statements here would be executed once during each loop iteration
  1720. WAITKEY 0,LOOPIT \ IF NOT CLK(V1,V2,V3,V4)LOOPIT
  1721.  
  1722. 'TO EXECUTE A LOOP UNTIL A NUMBER KEY IS PRESSED (ASCII VALUE 48 TO 57)
  1723. :LOOPNOW
  1724. 'any statements here would be executed once during each loop iteration
  1725. WAITKEY 0,LOOPNOW \ V0=[K] \ IF V0<48 LOOPNOW \ IF V0>57 LOOPNOW
  1726.  
  1727. 'TO BUILD A DEMO PROGRAM USING SCREEN FILES DEMO1.STF,DEMO2.STF,DEMO3.STF
  1728. 'AND DEMO4.STF USING A 3 SECOND DELAY BETWEEN SCREENS (NO FADES) AND ALLOWING
  1729. 'THE PROGRAM TO TERMINATE WHEN THE ESCAPE KEY IS PRESSED
  1730. 'NOTE: THIS PROGRAM USES INTERNAL BUFFERS 1 TO 4. (5 AND 6 ARE NOT USED)
  1731. ON INTKEY0 ESC GOTO QUIT
  1732. COPY(DEMO1,1)\COPY(DEMO2,2)\COPY(DEMO3,3)\COPY(DEMO4,4)
  1733. :START\COPY(1,0)\WAIT 3
  1734.        COPY(2,0)\WAIT 3
  1735.        COPY(3,0)\WAIT 3
  1736.        COPY(4,0)\WAIT 3\GOTO START
  1737. :QUIT\EXITC
  1738.  
  1739. 'TO BUILD A DEMO PROGRAM USING SCREEN FILES DEMO1.STF,DEMO2.STF,DEMO3.STF
  1740. 'AND DEMO4.STF USING A 3 SECOND DELAY BETWEEN SCREENS (NO FADES) AND ALLOWING
  1741. 'THE PROGRAM TO TERMINATE WHEN THE ESCAPE KEY IS PRESSED
  1742. 'NOTE: THIS PROGRAM DOES NOT USE ANY INTERNAL BUFFERS
  1743. '      THIS MEANS MORE DISK ACCESSES ARE NEEDED
  1744. ON INTKEY0 ESC GOTO QUIT
  1745. :START\COPY(DEMO1,0)\WAIT 3
  1746.        COPY(DEMO2,0)\WAIT 3
  1747.        COPY(DEMO3,0)\WAIT 3
  1748.        COPY(DEMO4,0)\WAIT 3\GOTO START
  1749. :QUIT\EXITC
  1750.  
  1751. 'TO PLACE A MARQUEE WINDOW ON THE SCREEN (WITH A MESSAGE)
  1752. COLOR 2,4\WINDOW (11,30,15,50) 104\BFILL 0 (12,31,14,49) ATTR 31
  1753. COLOR 15,1\P@13,35\PRINT "HELLO WORLD"
  1754.  
  1755. PROGRAMMING TRICKS AND TIPS  (continued)
  1756.  
  1757. BUFFER TEXT STRINGS
  1758.  
  1759. There is a special text string which can reside in any of the internal buffers
  1760. (0 to 63) that can be used in place of a quoted string when using PRINT, TTYPE
  1761. PLAY , XFLOAD and XFSAVE.
  1762.  
  1763. The form of the string is $(buf,row,startcolumn,endcolumn)
  1764.  
  1765. where ∙buf is the internal buffer to access (0 to 63)
  1766.       ∙row is the row (1 to 25) where the desired text resides in the buffer
  1767.       ∙startcolumn (1 to 80) and endcolumn (1 to 80) define the starting and
  1768.        ending column location of the text string 
  1769.  
  1770. Note that the information can be specified as numbers, variables (V0 to V255)
  1771. or indexed variables (VV0 to VV255).  If a number greater than 63 is specified,
  1772. the value is ANDed with 63 (to keep the value less than 64).
  1773.  
  1774. For example:
  1775.  
  1776. PRINT $(1,12,35,65) would find the text located in buffer 1 on row 12 starting
  1777.       at column 35 and ending at column 65.  This text would be printed on the
  1778.       screen in the current default color starting at the print cursor location.
  1779.  
  1780. TTYPE $(6,20,1,80) would slow-print the text (in buffer 6, on row 20 between
  1781.                    columns 1 and 80) on the screen.
  1782.  
  1783. PLAY $(4,1,40,60) would play the text string (in buffer 4, on row 1 between
  1784.                   columns 40 and 60).
  1785. ------------------------------------------------------------------------------
  1786. USING BUFFERS AS MEMORY
  1787.  
  1788. The internal buffers (1 to 63) can also be used as memory if the variables
  1789. (V0 to V255) are not enough storage space for data.  This method takes a
  1790. bit more work, but it can be done.  For example,
  1791.  
  1792. POKE 6(1,1)ASCII V2 would store a byte in buffer 6 at row=1, column=1
  1793. PEEK 6(1,1)ASCII V2 would retrieve the previously stored value.
  1794.  
  1795. POKE 6(1,1)ATTR V1 would store a byte in buffer 6 at row=1, column=1
  1796. PEEK 6(1,1)ATTR V1 would retrieve the previously stored value.
  1797.  
  1798. This means that each internal buffer can store 4000 bytes of program data
  1799. because (25 rows x 80 columns) = 2000 bytes. Each row/column position can store
  1800. an ASCII character byte and an ATTRibute byte, therefore 2 x 2000 = 4000 bytes.
  1801.  
  1802. PROGRAMMING TRICKS AND TIPS  (continued)
  1803.  
  1804. The following two listings show how to make a "custom" cursor.  In the first
  1805. example, a white/blue cross-hair symbol (ascii 197) is temporarily placed at
  1806. the cursor location but is replaced by the original character a fraction of a
  1807. second later.  In the second example, the attribute is XORed with 127 to make
  1808. the color "flicker".  Note: Your program should continuously cycle to the
  1809. label (:newcsr) in order to keep redisplaying the custom cursor.
  1810.  
  1811. Example 1.
  1812. :newcsr  %row=[r.] \ %col=[c.] \ csr off
  1813.          peek 0 (%row,%col) %char %attr
  1814.          poke 0 (%row,%col) 197   31    \ wait .09
  1815.          poke 0 (%row,%col) %char %attr \ wait .09 \ waitkey 0,newcsr
  1816.          'you can test key or click values here
  1817.  
  1818. Example 2.
  1819. :newcsr  %row=[r.] \ %col=[c.] \ csr off 
  1820.          peek 0 (%row,%col) attr %attr
  1821.          poke 0 (%row,%col) attr %attr#127 \ wait .09
  1822.          poke 0 (%row,%col) attr %attr     \ wait .09 \ waitkey 0,newcsr
  1823.          'you can test key or click values here
  1824.  
  1825. ##############################################################################
  1826.  
  1827. The following program listing is an alternative to the TEXT INPUT command.
  1828. It is included here in order to further demonstrate the use of ALIASes.
  1829.  
  1830. '------ MAIN PROGRAM ------------------------------------------------------
  1831.         ALIAS %ROW=V200,%COLUMN=V201
  1832.         COLOR 14,1 \ %ROW=10 \ %COLUMN=1 \ GOSUB INPUT
  1833.         EXIT
  1834. '--------------------------------------------------------------------------
  1835. '------ SUBROUTINE --------------------------------------------------------
  1836. :INPUT\ CSR \ C@ %ROW,%COLUMN \ P@ %ROW,%COLUMN \ WAITKEY 0,INPUT
  1837.         IF [K]=13 INPTX \ IF [K]=8 INPT2
  1838. :INPT1\ PRINT CHAR([K]); \ %COLUMN=[C;] \ GOTO INPUT
  1839. :INPT2\ %COLUMN-- \ POKE 0 (%ROW,%COLUMN)ASCII 32 \ GOTO INPUT
  1840. :INPTX\ RET 
  1841. '--------------------------------------------------------------------------
  1842.  
  1843. ##############################################################################
  1844.  
  1845. This short program segment shows how to link several screens together (e.g.
  1846. a HELP section).  The HELP screens are loaded into the upper buffers
  1847. (6O through 63). The Page-Up and Page-Down keys will sequentially cycle through
  1848. these buffers.  The Enter key provides a way to exit this routine.
  1849.  
  1850.        V1=6O \ COPY(HELP1,6O) \ COPY(HELP2,61) \ COPY(HELP3,62) \ COPY(HELP4,63)
  1851. :COPY\ COPY(V1,0)
  1852. :INPT\ WAITKEY  \ IF KEY PGUP DECR \ IF KEY ENTER QUIT 
  1853.                   IF KEY PGDN INCR \ GOTO INPT
  1854. :DECR\ IF V1=6O INPT \ V1=V1-1 \ GOTO COPY
  1855. :INCR\ IF V1=63 INPT \ V1=V1+1 \ GOTO COPY
  1856.  
  1857. :QUIT\ EXITC
  1858.  
  1859. PROGRAMMING TRICKS AND TIPS  (continued)
  1860. The new version of ShowText will allow the programmer to use row values
  1861. greater than 25 (up to 255).  This means that up to ten screens can be linked
  1862. together as though they were part of a large screen having up to 25O rows.
  1863. Note that buffers 1 to 66 are contiguous in memory, and buffers 67 to 73 are
  1864. contiguous in the video adapter memory, so that buffers 66 and 67 are not
  1865. contiguous.  This also means that programmers have access to certain
  1866. "undocumented" buffers outside the O to 63 range.
  1867.  
  1868.  ┌──────┬──────────────────────────────────────────────────────────┐
  1869.  │buffer│ Description                                              │
  1870.  ╞══════╪══════════════════════════════════════════════════════════╡
  1871. *│  64  │ temporary - usually holds last screen loaded from a file │
  1872.  ├──────┼──────────────────────────────────────────────────────────┤
  1873. *│  65  │ temporary - misc. I/O from last file load and screensaver│
  1874.  ├──────┼──────────────────────────────────────────────────────────┤
  1875.  │  66  │ temporary - used only by SAVE/RESTORE                    │
  1876.  ╞══════╪══════════════════════════════════════════════════════════╡
  1877. !│  67  │ CGA,EGA,VGA video adapter page 1 (text mode)             │
  1878.  ├──────┼──────────────────────────────────────────────────────────┤
  1879.  │  68  │ CGA,EGA,VGA video adapter page 2 (text mode)             │
  1880.  ├──────┼──────────────────────────────────────────────────────────┤
  1881.  │  69  │ CGA,EGA,VGA video adapter page 3 (text mode)             │
  1882.  ├──────┼──────────────────────────────────────────────────────────┤
  1883.  │  7O  │ CGA,EGA,VGA video adapter page 4 (text mode)             │
  1884.  ├──────┼──────────────────────────────────────────────────────────┤
  1885.  │  71  │ CGA,EGA,VGA video adapter page 5 (text mode)             │
  1886.  ├──────┼──────────────────────────────────────────────────────────┤
  1887.  │  72  │ CGA,EGA,VGA video adapter page 6 (text mode)             │
  1888.  ├──────┼──────────────────────────────────────────────────────────┤
  1889.  │  73  │ CGA,EGA,VGA video adapter page 7 (text mode)             │
  1890.  └──────┴──────────────────────────────────────────────────────────┘
  1891.  
  1892. ! Note: The ShowText menu program (ST.EXE) stores a 96-byte configuration block
  1893.         containing project name, path etc. in buffer 67 (row 1).
  1894.         If your program uses this area, it will be necessary for you to re-type
  1895.         the project name when you exit back to the ShowText menu. It only
  1896.         occurs when you are in the interactive ShowText environment.  This is a
  1897.         minor inconvenience and not a serious problem.
  1898.  
  1899. * Note: The COPY(source,destination) performs a screen-file-load if source is
  1900.         a name (not a variable or number).  e.g. COPY(filename,7)14
  1901.         The first temporary buffer (bfr=64) is overwritten only if a non-zero
  1902.         fade is specified on the screen-file-load COPY command. The second
  1903.         temporary buffer (bfr=65) is always overwritten by the command,
  1904.         COPY(filename,bfr).  Buffer 65 is also used as the screensaver area.
  1905.         Use these extra buffer areas carefully!
  1906.  
  1907. SHOWTEXT Revision History:
  1908. O3/2O/1995 - v 1.6
  1909.   +  Added the [BIOSaddr] system variable (e.g. [BIOS23] is kbd status byte #1)
  1910.   +  Added the option to use the NSTEP keyword (NegativeSTEP) in a FOR statement
  1911.   +  Added the timer(ticks)-in-range? system variable [TM:lowval:timer#:highval]
  1912.   *  Modified the timer(ticks) system variable [Tn] to allow math
  1913.      (e.g. %X=[T%i+1] )
  1914.   *  Modified the RST T instruction to allow math operations (e.g. RST T%i+1)
  1915.   *  Modified the RESTORE instruction so that it would also reset cursor limits
  1916.   √  Fixed a minor bug in the FOR/NEXT instructions to properly handle 
  1917.      math expressions.
  1918.  
  1919. O2/15/1995 - v 1.5
  1920.   +  Added the GOLOOP,EXITDO,GONEXT,EXITFOR,GOWEND,EXITWHILE instructions
  1921.   +  Added several options to the ShowText Drawing Program (STD.EXE)
  1922.   +  Added the DIRTOP,DIRBOT,DIRPRV,DIRNXT,DIRCMP,DIRCPY,DIRFND,DIRPRT commands
  1923.   +  Added the [FB:fg:bg] and [DIR] system variables
  1924.   *  Modified the compiler (STC.EXE) to show status bar during compilation
  1925.   +  Added the second form of the WINDOW command (i.e. with attribute value):
  1926.      WINDOW (r1,c1,r2,c2)windowtype,attribute
  1927.   *  Modified the XFSAVE/XFLOAD commands to use .STF file type (instead of .SCN)
  1928.   √  Fixed a bug in the COPY($(bfr,row,start,end),destbfr)fade command
  1929.   -  Removed the NAND(_), NOR(|) and XNOR(~) math operators and
  1930.      changed (|) to OR (same as @) - and also changed MOD symbol from ({) to (~)
  1931.  
  1932. O1/17/1995 - v 1.4
  1933.   *  Modified the SAVE/RESTORE commands to include ALL screen parameters
  1934.   +  Added the [IR:lowvalue:testvalue:highvalue] system variable (in-range?)
  1935.   +  Added the ability to imbed a system variable inside another system variable
  1936.   +  Added the $DOS, $LIB ADD and $LIB DIR compiler directives
  1937.   +  Added the P+ and P- commands
  1938.   *  Modified the COPY  command:
  1939.      It now allows COPY( $(bfr,row,startcolumn,endcolumn) , destbfr ) fade
  1940.      which performs a filename table lookup
  1941.  
  1942. SHOWTEXT Revision History (continued):
  1943. O9/28/1994 - v 1.3
  1944.   *  Modified the CLS   command: It now places the print cursor at row=1,col=1
  1945.   *  Modified the EXIT  command: It places the DOS cursor at the print cursor
  1946.   *  Modified the EXITC command: It now resets VIRTUAL mode before exiting
  1947.   *  Modified the ShareWare banner opening screen
  1948.  
  1949. O9/24/1994 - v 1.2
  1950.   +  Added new system variables: [AS:buf:row:col] , [AT:buf:row:col] and [VIRT]
  1951.   +  Added the XFLOAD and XFSAVE commands.
  1952.   √  Fixed a bug in the PLAY command (from v 1.1).
  1953.   +  Added the ability to specify buf=0 in the $(buf,row,col1,col2) text string
  1954.  
  1955. O7/O8/1994 - v 1.1
  1956.   +  Added ARROWS ON and ARROWS OFF commands
  1957.   +  Added the ability to use row>25 and/or col>80 for most operations
  1958.   +  Added IF-THEN-ELSEIF-ELSE-ENDIF
  1959.   +  Added SELECT CASE\CASE\CASE ELSE\END SELECT
  1960.   +  Added DO\LOOP and WHILE\WEND looping structures
  1961.   +  Added support for embedded mathematics expression evaluation including
  1962.      nested parentheses. 
  1963.   +  Added new mathematics operators:   ^  }  ++  -- 
  1964.   +  Added comparison operators:  <   =   >   <=   <>   >=
  1965.   +  Added logic operators:  NOT, AND,  OR, XOR, NAND, NOR, XNOR
  1966.                              (`)  (&)  (@)  (#)   (_)  (|)   (~)
  1967.   +  Added several new system variables 
  1968.      (e.g.  [OVR] and [.r1:c1:r2:c2] and [r1:c1:r2:c2.] )
  1969.   *  Changed the way that system variables are accessed.
  1970.      (ex:  old-way    SYS v1 KEY \ if v1=27 quit   )
  1971.      (ex:  new-way    if [K]=27 quit               )
  1972.  
  1973. O5/15/1994 - v 1.O
  1974.   +  Original public release as shareware.
  1975.  
  1976. MISCELLANEOUS PROGRAMS:
  1977. ───────────────────────────────────────────────────────────────────────────────
  1978. ANSIB.EXE   -This program will perform a variety of ANSI screen control
  1979.              commands from inside batch files. For more information, type ANSIB
  1980.              on the command line with no arguments.
  1981. ───────────────────────────────────────────────────────────────────────────────
  1982. GETAKEY.COM -This program pauses a batch file until a key is pressed.  The 
  1983.              ASCII value of that key is returned as the DOS ERRORLEVEL.  
  1984.              Extended keys such as F1 etc. are returned as 128+scan_code.
  1985.              These values are the same as the values in the keycode table in
  1986.              SHOWTEXT.DOC (except that F11 and F12 are not supported).  This
  1987.              program was meant to be used in batch files using self-displaying
  1988.              .COM files (with ECHO OFF) or with the SHOW.COM program..
  1989. ───────────────────────────────────────────────────────────────────────────────
  1990. RAT.EXE     -This program allows the mouse to be used inside batch files. For
  1991.              more information, type RAT on the command line with no arguments.
  1992. ───────────────────────────────────────────────────────────────────────────────
  1993. SHOW.COM    -This program will display an .STF file on the screen. It may be
  1994.              used in a batch file.  The syntax is SHOW filename or SHOW/P
  1995.              filename.  Note that an extension must NOT be specified on the
  1996.              command line.  The first syntax form (SHOW filename) will display
  1997.              the filename.STF on the screen and will continue.  The second form
  1998.              (SHOW/P filename) will display the filename.STF on the screen and
  1999.              will then pause until the user presses a key.  The ASCII value of
  2000.              that keystroke (or 128+scan_code_value for extended function keys)
  2001.              will be placed in the DOS ERRORLEVEL variable which can then be
  2002.              tested inside a batch file.  This can be used in a simple batch
  2003.              file menu system.
  2004. ───────────────────────────────────────────────────────────────────────────────
  2005. VIEWSCN.COM -This program will display a 4OOO-byte text screen image file on a
  2006.              color monitor.  The syntax is: VIEWSCN filename.ext, where the
  2007.              extension MUST be specified.  The STD drawing program is capable
  2008.              of storing screen images in this format as .SCN files.
  2009. ───────────────────────────────────────────────────────────────────────────────
  2010. Special Notes about using ANSIB and RAT :
  2011. 1. The batch file should be in the ECHO OFF mode when using the RAT or ANSIB
  2012.    programs.  This prevents screen scrolling.
  2013. 2. It is generally a good idea to execute the RAT RESET at the beginning of
  2014.    the batch file.  If the mouse driver is subsequently loaded/unloaded,
  2015.    then execute the RAT RESET again. It takes a second or two to reset the
  2016.    mouse driver, so your batch file should do this only once (if at all).
  2017. 3. RAT uses the intra-application communication area at OOOO:O4FO, therefore
  2018.    any application program that utilizes this area will cause RAT to reset
  2019.    itself each time. This is a very minor consideration since very few 
  2020.    programs use this area.
  2021. 4. Each application program should leave the mouse pointer in the hidden
  2022.    state.  This is the assumption made by the RAT program.
  2023. 5. Each application program should exit to DOS in the 8O-column, 25-row
  2024.    TEXT mode.  If it doesn't, then be sure to execute MODE CO80 before
  2025.    running the RAT program.
  2026. 6. The RAT program can be used to retrieve KEYcodes even if the mouse is
  2027.    not available. Of course, there will not be a mouse cursor.
  2028.  
  2029. SHOWTEXT REGISTRATION ORDER FORM
  2030.  
  2031. (The REGISTERED version does not generate the initial UNREGISTERED banner
  2032.  and includes a text-screen capture program and a program to convert drawing
  2033.  files between the following forms: .ANS=(ANSI) .ASC=(Plain ASCII Text)
  2034.  .BSV=(Basic's BSAVE/BLOAD) .COM=(stand-alone executable) .SCN=(4OOO byte
  2035.  screen image) and .STF=(ShowTextFile format).
  2036.  
  2037. Name     ____________________________________________________
  2038.  
  2039. Address  ____________________________________________________
  2040.  
  2041.          ____________________________________________________
  2042.  
  2043.          ____________________________________________________
  2044.  
  2045. Please specify the version of ShowText you are using and where you got it.
  2046.          Version ____________     Source ____________________
  2047.  
  2048. NOTE: SHOWTEXT is distributed on high-density disks ONLY !!!
  2049. Disk Type (check one)   [ ] 5.25" (1.2  Meg)     or    [ ]  3.5" (1.44 Meg)
  2050.  
  2051. Please make check/money order ( $ 25.OO ) to: Garry Spencer/Spencer Technologies
  2052.  
  2053. and mail to: Garry Spencer/Spencer Technologies
  2054.              P. O. Box 34OO9 - Memphis, TN - 38184-OOO9
  2055.              Please do not send cash.  Please allow 3 to 4 weeks for delivery.
  2056.  
  2057. Licensing Information and Disclaimer:
  2058. ------------------------------------------------------------------------------
  2059. O.K. , here's the deal:
  2060. Many hours have been spent on the design and programming of the ShowText system.
  2061. (This is an understatement :-).  Every command has been carefully tested,
  2062. HOWEVER Spencer Technologies/Garry Spencer and any operating principals of the
  2063. company are not liable for the use of this software.
  2064.  
  2065. Upon receipt of your registration fee, you will be sent the latest REGISTERED
  2066. version of ShowText.  The REGISTERED version will be in a sealed package.
  2067. EACH diskette is checked for readability before shipping!  When the REGISTERED
  2068. version is opened and the seal is broken, it may NOT be returned and remitted
  2069. funds are NOT refundable.
  2070.  
  2071. You will be issued a unique registration code which entitles you to technical
  2072. support (up to two requests by MAIL only).  This explains why the registration
  2073. fee is so low, compared to other packages costing nearly $100 (or more).
  2074. Please consider the cost of duplication, handling, postage, taxes, pizza etc.
  2075.  
  2076. Please sign below if you agree with the terms and limitations of this license
  2077. agreement.  Only signed order forms can be processed.  Thank you for ordering
  2078. ShowText.
  2079.  
  2080. Signature _____________________________
  2081.  
  2082.